buffer
Allow for a temporarily faster upstream events by buffering size elements.
Signature
Source.bufferSource.buffer Flow.bufferFlow.buffer
Description
Allow for a temporarily faster upstream events by buffering size elements. When the buffer is full, a new element is handled according to the specified OverflowStrategy:
backpressurebackpressure is applied upstreamdropHeaddrops the oldest element in the buffer to make space for the new elementdropTaildrops the youngest element in the buffer to make space for the new elementdropBufferdrops the entire buffer and buffers the new elementdropNewdrops the new elementfailfails the flow with aBufferOverflowException
Reactive Streams semantics
emits when downstream stops backpressuring and there is a pending element in the buffer
backpressures when OverflowStrategy is backpressure and buffer is full
completes when upstream completes and buffered elements has been drained, or when OverflowStrategy is fail, the buffer is full and a new element arrives
1.0.0