pub fn batch<S, T>(
stream: S,
size: usize,
timeout: Duration,
) -> impl Stream<Item = Vec<T>> + Send + 'staticExpand description
Collect up to size items into a batch.
A batch is emitted either when size items arrive
or when timeout elapses since the first item in the batch.