Interface SegmentCompletionPublisher<R>
-
- Type Parameters:
R- value type
- All Superinterfaces:
org.reactivestreams.Publisher<R>
- All Known Subinterfaces:
SegmentAwarePublisher<R>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SegmentCompletionPublisher<R> extends org.reactivestreams.Publisher<R>
APublisherthat also notifies in a thread safe manner when a segment has sent all values upstream. To more specifically detail the guarantee, theacceptmethod of the providedIntConsumerwill be invoked serially inline withonNext,onError,onCompleteand will only be invoked after all values from the given segment have already been notified via {@code 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.
-
-
Field Summary
Fields Modifier and Type Field Description static IntConsumerEMPTY_CONSUMER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidsubscribe(org.reactivestreams.Subscriber<? super R> s)voidsubscribe(org.reactivestreams.Subscriber<? super R> s, IntConsumer completedSegmentConsumer)Same asPublisher.subscribe(Subscriber), except that we also can notify a listener when a segment has published all of its entries
-
-
-
Field Detail
-
EMPTY_CONSUMER
static final IntConsumer EMPTY_CONSUMER
-
-
Method Detail
-
subscribe
void subscribe(org.reactivestreams.Subscriber<? super R> s, IntConsumer completedSegmentConsumer)
Same asPublisher.subscribe(Subscriber), except that we also can notify a listener when a segment has published all of its entries- Parameters:
s- subscriber to be notified of values and completioncompletedSegmentConsumer- segment notifier to notify
-
-