- Type Parameters:
T- the type of item.
- All Superinterfaces:
Flow.Subscriber<T>
- All Known Subinterfaces:
CancellableSubscriber<T>
- All Known Implementing Classes:
AssertSubscriber,MultiSubscriberAdapter,SerializedSubscriber,Subscribers.CallbackBasedSubscriber,SwitchableSubscriptionSubscriber
A
Flow.Subscriber receiving calls to Flow.Subscriber.onSubscribe(Subscription) once after passing an instance of
Flow.Subscriber to Flow.Publisher.subscribe(Subscriber).
No further events will be received until Flow.Subscription.request(long) is called.
After signaling demand:
- One or more invocations of
onItem(Object)up to the maximum number defined byFlow.Subscription.request(long) - Single invocation of
onFailure(Throwable)oronCompletion()which signals a terminal state after which no further events will be sent.
Demand can be signaled via Flow.Subscription.request(long) whenever the Flow.Subscriber instance is capable of handling
more.
This interface bridges the Mutiny model and the Reactive Streams model.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidSuccessful terminal state.voidMethod called when the upstream emits acompletionterminal event.default voidFailed terminal state.voidMethod called when the upstream emits afailureterminal event.voidMethod called when the upstream emits anitemevent, in response to to requests toFlow.Subscription.request(long).default voidData notification sent by theFlow.Publisherin response to requests toFlow.Subscription.request(long).Methods inherited from interface java.util.concurrent.Flow.Subscriber
onSubscribe
-
Method Details
-
onItem
Method called when the upstream emits anitemevent, in response to to requests toFlow.Subscription.request(long).- Parameters:
item- the item, must not benull.
-
onFailure
Method called when the upstream emits afailureterminal event.No further events will be sent even if
Flow.Subscription.request(long)is invoked again.- Parameters:
failure- the failure, must not benull.
-
onCompletion
void onCompletion()Method called when the upstream emits acompletionterminal event.No further events will be sent even if
Flow.Subscription.request(long)is invoked again. -
onNext
Data notification sent by theFlow.Publisherin response to requests toFlow.Subscription.request(long). Delegates toonItem(Object)- Specified by:
onNextin interfaceFlow.Subscriber<T>- Parameters:
t- the element signaled
-
onError
Failed terminal state.No further events will be sent even if
Flow.Subscription.request(long)is invoked again. Delegates toonFailure(Throwable)- Specified by:
onErrorin interfaceFlow.Subscriber<T>- Parameters:
t- the throwable signaled
-
onComplete
default void onComplete()Successful terminal state.No further events will be sent even if
Flow.Subscription.request(long)is invoked again. Delegates toonCompletion()- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-