batch-channel

Crates.iobatch-channel
lib.rsbatch-channel
version0.4.1
sourcesrc
created_at2023-08-03 03:20:13.185419
updated_at2024-06-30 18:30:55.626574
descriptionasync channel that reduces overhead by reading and writing many values at once
homepage
repositoryhttps://github.com/chadaustin/batch-channel
max_upload_size
id933353
size114,275
Chad Austin (chadaustin)

documentation

README

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:

  • Channels with priority
  • impls for futures::sink::Sink and futures::stream::Stream

Ask if they would be helpful.

Commit count: 184

cargo fmt