| Crates.io | batch-channel |
| lib.rs | batch-channel |
| version | 0.4.4 |
| created_at | 2023-08-03 03:20:13.185419+00 |
| updated_at | 2025-08-23 22:08:05.536207+00 |
| description | async channel that reduces overhead by reading and writing many values at once |
| homepage | |
| repository | https://github.com/chadaustin/batch-channel |
| max_upload_size | |
| id | 933353 |
| size | 165,956 |
async MPMC channel that reduces overhead by reading and writing many values at once.
Sometimes large volumes of small values are farmed out to workers through a channel. Consider directory traversal: each readdir() call produces a batch of directory entries. Batching can help the consumption side too. Consider querying SQLite with received values -- larger batches reduce the amortized cost of acquiring SQLite's lock and bulk queries can be issued.
One can imagine natural, currently unimplemented, extensions to this crate:
futures::sink::Sink and futures::stream::StreamAsk if they would be helpful.