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>
public interface SubscriberBuilder<T,R> extends ProducesResult<R>
A builder for aSubscriber
and its result.When built, this builder returns a
CompletionSubscriber
, which encapsulates both aSubscriber
and aCompletionStage
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. ASubscriberBuilder
may represent a compound set of stream stages and may complete exceptionally without receiving an error externally. Similarly,SubscriberBuilder
s may encapsulate error handling such as the onErrorResume operator and recover from an externally received errors.- See Also:
ReactiveStreams
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionSubscriber<T,R>
build()
Build this stream, using the firstReactiveStreamsEngine
found by theServiceLoader
.CompletionSubscriber<T,R>
build(ReactiveStreamsEngine engine)
Build this stream, using the suppliedReactiveStreamsEngine
.
-
-
-
Method Detail
-
build
CompletionSubscriber<T,R> build()
Build this stream, using the firstReactiveStreamsEngine
found by theServiceLoader
.- Returns:
- A
CompletionSubscriber
that will run this stream.
-
build
CompletionSubscriber<T,R> build(ReactiveStreamsEngine engine)
Build this stream, using the suppliedReactiveStreamsEngine
.- Parameters:
engine
- The engine to run the stream with.- Returns:
- A
CompletionSubscriber
that will run this stream.
-
-