Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pragmaxim committed Jun 11, 2024
1 parent 93cc045 commit 1fa6f3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
[![Cargo](https://img.shields.io/crates/v/futures-batch.svg)](https://crates.io/crates/futures-batch)
[![Documentation](https://docs.rs/futures-batch/badge.svg)](https://docs.rs/futures-batch)

An adapter that turns elements into a batch of minimal element count. Needed for efficient work
parallelization so that following tasks running in parallel are all processing at least
`min_batch_size` of elements to avoid context switching overhead of cpu intensive workloads.
An adapter that turns elements into a batch and its minimal size is computed by given closure.
It is needed for efficient work parallelization so that following tasks running in parallel
are all processing a batch of at least `min_batch_size` to avoid context switching overhead
of cpu intensive workloads. Otherwise we usually need to introduce some kind of publish/subscribe
model with dedicated long-running thread for each consumer and broadcasting messages to them
and establishing back-pressure through [barrier](https://docs.rs/tokio/latest/tokio/sync/struct.Barrier.html).

## Usage

Expand Down

0 comments on commit 1fa6f3b

Please sign in to comment.