Package io.smallrye.mutiny.subscription
Class UniDelegatingSubscriber<I,O>
- java.lang.Object
-
- io.smallrye.mutiny.subscription.UniDelegatingSubscriber<I,O>
-
- All Implemented Interfaces:
UniSubscriber<I>
public class UniDelegatingSubscriber<I,O> extends java.lang.Object implements UniSubscriber<I>
-
-
Constructor Summary
Constructors Constructor Description UniDelegatingSubscriber(UniSubscriber<? super O> subscriber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonFailure(java.lang.Throwable failure)Called if the computation of the item by the subscriberUnifailed.voidonItem(I item)Event handler called once the item has been computed by the subscribedUni.voidonSubscribe(UniSubscription subscription)Event handler called once the subscribedUnihas taken into account the subscription.
-
-
-
Constructor Detail
-
UniDelegatingSubscriber
public UniDelegatingSubscriber(UniSubscriber<? super O> subscriber)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(UniSubscription subscription)
Description copied from interface:UniSubscriberEvent handler called once the subscribedUnihas taken into account the subscription. TheUnihave triggered the computation of the item. IMPORTANT:UniSubscriber.onItem(Object)andUniSubscriber.onFailure(Throwable)would not be called before the invocation of this method.- Executor: Operate on no particular executor, except if
Uni.runSubscriptionOn(Executor)has been called - Exception: Throwing an exception cancels the subscription,
UniSubscriber.onItem(Object)andUniSubscriber.onFailure(Throwable)won't be called
- Specified by:
onSubscribein interfaceUniSubscriber<I>- Parameters:
subscription- the subscription allowing to cancel the computation.
- Executor: Operate on no particular executor, except if
-
onItem
public void onItem(I item)
Description copied from interface:UniSubscriberEvent handler called once the item has been computed by the subscribedUni. IMPORTANT: this method will be only called once per subscription. IfUniSubscriber.onFailure(Throwable)is called, this method won't be called.- Executor: Operate on no particular executor, except if
Uni.emitOn(java.util.concurrent.Executor)has been called - Exception: Throwing an exception cancels the subscription.
- Specified by:
onItemin interfaceUniSubscriber<I>- Parameters:
item- the item, may benull.
- Executor: Operate on no particular executor, except if
-
onFailure
public void onFailure(java.lang.Throwable failure)
Description copied from interface:UniSubscriberCalled if the computation of the item by the subscriberUnifailed. IMPORTANT: this method will be only called once per subscription. IfUniSubscriber.onItem(Object)is called, this method won't be called.- Executor: Operate on no particular executor, except if
Uni.emitOn(java.util.concurrent.Executor)has been called - Exception: Throwing an exception cancels the subscription.
- Specified by:
onFailurein interfaceUniSubscriber<I>- Parameters:
failure- the failure, cannot benull.
- Executor: Operate on no particular executor, except if
-
-