R
- value type@FunctionalInterface public interface SegmentCompletionPublisher<R> extends org.reactivestreams.Publisher<R>
Publisher
that also notifies in a thread safe manner when a segment has sent all values upstream. To more
specifically detail the guarantee, the accept
method of the provided IntConsumer
will be invoked
serially inline with onNext
, onError
, onComplete
and will only be invoked after all values
from the given segment have already been notified via onNext). Note that there is no guarantee that the previous
values was from the given segment, only that all have been notified prior.
If segment completion is not needed, use the {@link Publisher#subscribe(Subscriber)} or provided {@link #EMPTY_CONSUMER} as the argument to the {@link #subscribe(Subscriber, IntConsumer)} method. This allows implementors to optimize for the case when segment completion is not needed as this may require additional overhead.
Modifier and Type | Field and Description |
---|---|
static IntConsumer |
EMPTY_CONSUMER |
Modifier and Type | Method and Description |
---|---|
default void |
subscribe(org.reactivestreams.Subscriber<? super R> s) |
void |
subscribe(org.reactivestreams.Subscriber<? super R> s,
IntConsumer completedSegmentConsumer)
Same as
Publisher.subscribe(Subscriber) , except that we also can notify a listener
when a segment has published all of its entries |
static final IntConsumer EMPTY_CONSUMER
void subscribe(org.reactivestreams.Subscriber<? super R> s, IntConsumer completedSegmentConsumer)
Publisher.subscribe(Subscriber)
, except that we also can notify a listener
when a segment has published all of its entriess
- subscriber to be notified of values and completioncompletedSegmentConsumer
- segment notifier to notifyCopyright © 2021 JBoss by Red Hat. All rights reserved.