BufferExtensions<T> extension

Extends the Stream class with the ability to buffer events in various ways

on

Methods

buffer(Stream<void> window) Stream<List<T>>

Available on Stream<T>, provided by the BufferExtensions extension

Creates a Stream where each item is a List containing the items from the source sequence.
bufferCount(int count, [int startBufferEvery = 0]) Stream<List<T>>

Available on Stream<T>, provided by the BufferExtensions extension

Buffers a number of values from the source Stream by count then emits the buffer and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted.
bufferTest(bool onTestHandler(T event)) Stream<List<T>>

Available on Stream<T>, provided by the BufferExtensions extension

Creates a Stream where each item is a List containing the items from the source sequence, batched whenever test passes.
bufferTime(Duration duration) Stream<List<T>>

Available on Stream<T>, provided by the BufferExtensions extension

Creates a Stream where each item is a List containing the items from the source sequence, sampled on a time frame with duration.