Package io.smallrye.mutiny.subscription
Interface MultiSubscriber<T>
-
- Type Parameters:
T
- the type of item.
- All Superinterfaces:
org.reactivestreams.Subscriber<T>
- All Known Subinterfaces:
CancellableSubscriber<T>
- All Known Implementing Classes:
MultiFailOnItemTimeout.MultiFailOnItemTimeoutProcessor
,MultiFlatMapOp.FlatMapMainSubscriber
,MultiGroupByOp.MultiGroupByProcessor
,MultiIgnoreOp.MultiIgnoreProcessor
,MultiMapOp.MapProcessor
,MultiOperatorProcessor
,MultiReferenceCountSubscriber
,MultiRepeatUntilOp.RepeatProcessor
,MultiSelectFirstUntilOtherOp.TakeUntilMainProcessor
,MultiSelectFirstUntilOtherOp.TakeUntilOtherSubscriber
,SerializedMultiEmitter
,SerializedSubscriber
,StrictMultiSubscriber
,Subscribers.CallbackBasedSubscriber
,SwitchableSubscriptionSubscriber
public interface MultiSubscriber<T> extends org.reactivestreams.Subscriber<T>
ASubscriber
receiving calls toSubscriber.onSubscribe(Subscription)
once after passing an instance ofSubscriber
toPublisher.subscribe(Subscriber)
.No further events will be received until
Subscription.request(long)
is called.After signaling demand:
- One or more invocations of
onItem(Object)
up to the maximum number defined bySubscription.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
Subscription.request(long)
whenever theSubscriber
instance is capable of handling more. This interface bridges the Mutiny model and the Reactive Streams model.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
onComplete()
Successful terminal state.void
onCompletion()
Method called when the upstream emits acompletion
terminal event.default void
onError(java.lang.Throwable t)
Failed terminal state.void
onFailure(java.lang.Throwable failure)
Method called when the upstream emits afailure
terminal event.void
onItem(T item)
Method called when the upstream emits anitem
event, in response to to requests toSubscription.request(long)
.default void
onNext(T t)
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.
-
-
-
Method Detail
-
onItem
void onItem(T item)
Method called when the upstream emits anitem
event, in response to to requests toSubscription.request(long)
.- Parameters:
item
- the item, must not benull
.
-
onFailure
void onFailure(java.lang.Throwable failure)
Method called when the upstream emits afailure
terminal event.No further events will be sent even if
Subscription.request(long)
is invoked again.- Parameters:
failure
- the failure, must not benull
.
-
onCompletion
void onCompletion()
Method called when the upstream emits acompletion
terminal event.No further events will be sent even if
Subscription.request(long)
is invoked again.
-
onNext
default void onNext(T t)
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
. Delegates toonItem(Object)
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
- Parameters:
t
- the element signaled
-
onError
default void onError(java.lang.Throwable t)
Failed terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again. Delegates toonFailure(Throwable)
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
- Parameters:
t
- the throwable signaled
-
onComplete
default void onComplete()
Successful terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again. Delegates toonCompletion()
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
-