Class MultiOperatorProcessor<I,O>
- java.lang.Object
-
- io.smallrye.mutiny.operators.multi.MultiOperatorProcessor<I,O>
-
- All Implemented Interfaces:
ContextSupport,MultiSubscriber<I>,org.reactivestreams.Subscriber<I>,org.reactivestreams.Subscription
- Direct Known Subclasses:
MultiFailOnItemTimeout.MultiFailOnItemTimeoutProcessor,MultiGroupByOp.MultiGroupByProcessor,MultiIgnoreOp.MultiIgnoreProcessor,MultiMapOp.MapProcessor,MultiReferenceCountSubscriber,MultiSelectFirstUntilOtherOp.TakeUntilMainProcessor
public abstract class MultiOperatorProcessor<I,O> extends java.lang.Object implements MultiSubscriber<I>, org.reactivestreams.Subscription, ContextSupport
-
-
Field Summary
Fields Modifier and Type Field Description protected MultiSubscriber<? super O>downstreamprotected org.reactivestreams.Subscriptionupstream
-
Constructor Summary
Constructors Constructor Description MultiOperatorProcessor(MultiSubscriber<? super O> downstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()protected voidcancelUpstream()protected booleancompareAndSetUpstreamSubscription(org.reactivestreams.Subscription expectedValue, org.reactivestreams.Subscription newValue)protected booleancompareAndSwapDownstreamCancellationRequest()Contextcontext()Provide a context.protected org.reactivestreams.SubscriptiongetAndSetUpstreamSubscription(org.reactivestreams.Subscription newValue)protected org.reactivestreams.SubscriptiongetUpstreamSubscription()protected booleanisCancelled()protected booleanisDone()voidonCompletion()Method called when the upstream emits acompletionterminal event.voidonFailure(java.lang.Throwable throwable)Method called when the upstream emits afailureterminal event.voidonItem(I item)Method called when the upstream emits anitemevent, in response to to requests toSubscription.request(long).voidonSubscribe(org.reactivestreams.Subscription subscription)voidrequest(long numberOfItems)-
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
-
-
-
-
Field Detail
-
downstream
protected volatile MultiSubscriber<? super O> downstream
-
upstream
protected volatile org.reactivestreams.Subscription upstream
-
-
Constructor Detail
-
MultiOperatorProcessor
public MultiOperatorProcessor(MultiSubscriber<? super O> downstream)
-
-
Method Detail
-
getUpstreamSubscription
protected org.reactivestreams.Subscription getUpstreamSubscription()
-
compareAndSetUpstreamSubscription
protected boolean compareAndSetUpstreamSubscription(org.reactivestreams.Subscription expectedValue, org.reactivestreams.Subscription newValue)
-
getAndSetUpstreamSubscription
protected org.reactivestreams.Subscription getAndSetUpstreamSubscription(org.reactivestreams.Subscription newValue)
-
isDone
protected boolean isDone()
-
isCancelled
protected boolean isCancelled()
-
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.
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<I>
-
onFailure
public void onFailure(java.lang.Throwable throwable)
Description copied from interface:MultiSubscriberMethod called when the upstream emits afailureterminal event.No further events will be sent even if
Subscription.request(long)is invoked again.- Specified by:
onFailurein interfaceMultiSubscriber<I>- Parameters:
throwable- the failure, must not benull.
-
onItem
public void onItem(I item)
Description copied from interface:MultiSubscriberMethod called when the upstream emits anitemevent, in response to to requests toSubscription.request(long).- Specified by:
onItemin interfaceMultiSubscriber<I>- Parameters:
item- the item, 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
Subscription.request(long)is invoked again.- Specified by:
onCompletionin interfaceMultiSubscriber<I>
-
request
public void request(long numberOfItems)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
compareAndSwapDownstreamCancellationRequest
protected final boolean compareAndSwapDownstreamCancellationRequest()
-
cancelUpstream
protected void cancelUpstream()
-
-