Interface SubscriberBuilder<T,R>
- Type Parameters:
T- The type of the elements that this subscriber consumes.R- The type of the result that this subscriber emits.
- All Superinterfaces:
ProducesResult<R>
A builder for a
Subscriber and its result.
When built, this builder returns a CompletionSubscriber, which encapsulates both a
Subscriber and a CompletionStage that will be redeemed with
the result produced by the subscriber when the stream completes normally, or will be redeemed with an error if the
subscriber receives an error. A SubscriberBuilder may represent a compound set of stream stages and may
complete exceptionally without receiving an error externally. Similarly, SubscriberBuilders may encapsulate
error handling such as the onErrorResume operator and recover from an externally received errors.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build this stream, using the firstReactiveStreamsEnginefound by theServiceLoader.build(ReactiveStreamsEngine engine) Build this stream, using the suppliedReactiveStreamsEngine.
-
Method Details
-
build
CompletionSubscriber<T,R> build()Build this stream, using the firstReactiveStreamsEnginefound by theServiceLoader.- Returns:
- A
CompletionSubscriberthat will run this stream.
-
build
Build this stream, using the suppliedReactiveStreamsEngine.- Parameters:
engine- The engine to run the stream with.- Returns:
- A
CompletionSubscriberthat will run this stream.
-