- java.lang.Object
-
- io.smallrye.mutiny.subscription.MultiSubscriberAdapter<T>
-
- Type Parameters:
T- the elements type
- All Implemented Interfaces:
ContextSupport,MultiSubscriber<T>,java.util.concurrent.Flow.Subscriber<T>
public class MultiSubscriberAdapter<T> extends java.lang.Object implements MultiSubscriber<T>, ContextSupport
Thin adapter of aFlow.Subscriberto a MutinyMultiSubscriber.
-
-
Constructor Summary
Constructors Constructor Description MultiSubscriberAdapter(java.util.concurrent.Flow.Subscriber<? super T> downstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Contextcontext()Provide a context.voidonCompletion()Method called when the upstream emits acompletionterminal event.voidonFailure(java.lang.Throwable failure)Method called when the upstream emits afailureterminal event.voidonItem(T item)Method called when the upstream emits anitemevent, in response to to requests toFlow.Subscription.request(long).voidonSubscribe(java.util.concurrent.Flow.Subscription subscription)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.mutiny.subscription.MultiSubscriber
onComplete, onError, onNext
-
-
-
-
Constructor Detail
-
MultiSubscriberAdapter
public MultiSubscriberAdapter(java.util.concurrent.Flow.Subscriber<? super T> downstream)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(java.util.concurrent.Flow.Subscription subscription)
- Specified by:
onSubscribein interfacejava.util.concurrent.Flow.Subscriber<T>
-
onItem
public void onItem(T item)
Description copied from interface:MultiSubscriberMethod called when the upstream emits anitemevent, in response to to requests toFlow.Subscription.request(long).- Specified by:
onItemin interfaceMultiSubscriber<T>- Parameters:
item- the item, must not benull.
-
onFailure
public void onFailure(java.lang.Throwable failure)
Description copied from interface:MultiSubscriberMethod called when the upstream emits afailureterminal event.No further events will be sent even if
Flow.Subscription.request(long)is invoked again.- Specified by:
onFailurein interfaceMultiSubscriber<T>- Parameters:
failure- the failure, must not benull.
-
onCompletion
public void onCompletion()
Description copied from interface:MultiSubscriberMethod called when the upstream emits acompletionterminal event.No further events will be sent even if
Flow.Subscription.request(long)is invoked again.- Specified by:
onCompletionin interfaceMultiSubscriber<T>
-
context
public Context context()
Description copied from interface:ContextSupportProvide a context.Since calls to this method shall only be triggered when a Mutiny pipeline uses a
withContextoperator, there is no need in general for caching the context value in a field of the implementing class. Exceptions include operators that have cross-subscriber semantics such as memoizers or broadcasters.This method is expected to be called once per
withContextoperator.- Specified by:
contextin interfaceContextSupport- Returns:
- the context, must not be
null.
-
-