chadaustin / batch-channel

Async channels for Rust that support reading and writing many values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Async channels for Rust that support reading and writing many values

License:MIT License


Languages

Language:Rust 98.8%Language:Shell 1.2%