Class FlowAdapters.ReactiveToFlowProcessor<T,U>
- Type Parameters:
T
- the input typeU
- the output type
- All Implemented Interfaces:
Processor<T,
,U> Publisher<U>
,Subscriber<T>
- Enclosing class:
FlowAdapters
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Successful terminal state.void
Failed terminal state.void
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.void
onSubscribe
(Subscription subscription) Invoked after callingPublisher.subscribe(Subscriber)
.void
subscribe
(Subscriber<? super U> s) RequestPublisher
to start streaming data.
-
Field Details
-
flow
-
-
Constructor Details
-
ReactiveToFlowProcessor
-
-
Method Details
-
onSubscribe
Description copied from interface:Subscriber
Invoked after callingPublisher.subscribe(Subscriber)
.No data will start flowing until
Subscription.request(long)
is invoked.It is the responsibility of this
Subscriber
instance to callSubscription.request(long)
whenever more data is wanted.The
Publisher
will send notifications only in response toSubscription.request(long)
.- Specified by:
onSubscribe
in interfaceSubscriber<T>
- Parameters:
subscription
- theSubscription
that allows requesting data viaSubscription.request(long)
-
onNext
Description copied from interface:Subscriber
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.- Specified by:
onNext
in interfaceSubscriber<T>
- Parameters:
t
- the element signaled
-
onError
Description copied from interface:Subscriber
Failed terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again.- Specified by:
onError
in interfaceSubscriber<T>
- Parameters:
t
- the throwable signaled
-
onComplete
public void onComplete()Description copied from interface:Subscriber
Successful terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again.- Specified by:
onComplete
in interfaceSubscriber<T>
-
subscribe
Description copied from interface:Publisher
RequestPublisher
to start streaming data.This is a "factory method" and can be called multiple times, each time starting a new
Subscription
.Each
Subscription
will work for only a singleSubscriber
.A
Subscriber
should only subscribe once to a singlePublisher
.If the
Publisher
rejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(Throwable)
.- Specified by:
subscribe
in interfacePublisher<T>
- Parameters:
s
- theSubscriber
that will consume signals from thisPublisher
-