Batch insert to db data received from channel

Hi,

I have a Tokio task that receives data via tokio::sync::mpsc channel. As the data comes in I would like to insert it into database in batches. I'm wondering if there's a good crate for batching data (before calling db with a batch), or should I create my own batching logic.

What do you suggest?

I don't think you will find a good crate for this. I recommend you write your own batching logic.

1 Like