Interface SegmentPublisherSupplier<R>
-
- Type Parameters:
R
- value type
- All Known Subinterfaces:
SegmentAwarePublisherSupplier<R>
public interface SegmentPublisherSupplier<R>
APublisher
that also notifies in a thread safe manner when a segment has sent all values upstream. To more specifically detail the guarantee, theaccept
method of the providedIntConsumer
will be invoked serially inline withonNext
,onError
,onComplete
and 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SegmentPublisherSupplier.Notification<R>
Wrapper around an element returned that can either be a value or a segment completion.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.reactivestreams.Publisher<R>
publisherWithoutSegments()
org.reactivestreams.Publisher<SegmentPublisherSupplier.Notification<R>>
publisherWithSegments()
-
-
-
Method Detail
-
publisherWithoutSegments
org.reactivestreams.Publisher<R> publisherWithoutSegments()
-
publisherWithSegments
org.reactivestreams.Publisher<SegmentPublisherSupplier.Notification<R>> publisherWithSegments()
-
-