Skip to main content

buffer_ready_items

Function buffer_ready_items 

Source
pub fn buffer_ready_items<'b, S, E>(
    stream: S,
    count: usize,
) -> impl Stream<Item = Result<Bytes, E>> + Send + 'b
where S: Stream<Item = Result<Bytes, E>> + Send + 'b, E: 'b,
Expand description

Coalesce every count items that are ready at the same time into one chunk.

Uses readiness rather than a fixed count, so a slow producer is never held back waiting for a batch to fill.