T
- items emitted from the Publisher
which are to be buffered using this BufferStrategy
.BC
- An intermediate mutable object that holds the items into a buffer before it is emitted.B
- The buffer of items.public interface BufferStrategy<T,BC extends BufferStrategy.Accumulator<T,B>,B>
buffering
items emitted from a Publisher
.
A buffer strategy represents asynchronous buffer boundaries
over which items from a
Publisher
are buffered. Each item emitted from the boundary Publisher
represents the end of the
last boundary and start of the next boundary. The first item emitted from this Publisher
is treated as the
start of the first boundary and Publisher.buffer(BufferStrategy)
may decide to defer requesting items from
the Publisher
on which that operator is applied.
Modifier and Type | Interface and Description |
---|---|
static interface |
BufferStrategy.Accumulator<T,B>
An intermediate mutable object that holds items till it is
finished . |
Modifier and Type | Method and Description |
---|---|
Publisher<BC> |
boundaries()
Returns a
Publisher representing asynchronous buffer boundaries. |
int |
bufferSizeHint()
A rough estimate of the number of items in a buffer.
|
Publisher<BC> boundaries()
Publisher
representing asynchronous buffer boundaries. This Publisher
is expected to be
an infinite Publisher
. Hence, it should never terminate any PublisherSource.Subscriber
subscribed to it. Instead
PublisherSource.Subscriber
s will always cancel
their PublisherSource.Subscription
. If this
expectation is violated, buffered items may be discarded.Publisher
representing asynchronous buffer boundaries.int bufferSizeHint()