Class MultiCacheOp<T>
- java.lang.Object
-
- io.smallrye.mutiny.operators.AbstractMulti<O>
-
- io.smallrye.mutiny.operators.multi.AbstractMultiOperator<T,T>
-
- io.smallrye.mutiny.operators.multi.MultiCacheOp<T>
-
- Type Parameters:
T
- the type of item
- All Implemented Interfaces:
Multi<T>
,ContextSupport
,org.reactivestreams.Publisher<T>
,org.reactivestreams.Subscriber<T>
public class MultiCacheOp<T> extends AbstractMultiOperator<T,T> implements org.reactivestreams.Subscriber<T>, ContextSupport
Amulti
caching the events emitted from upstreams and replaying it to subscribers. This multi can have several subscribers.
-
-
Field Summary
-
Fields inherited from class io.smallrye.mutiny.operators.multi.AbstractMultiOperator
upstream
-
-
Constructor Summary
Constructors Constructor Description MultiCacheOp(Multi<T> upstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
context()
Provide a context.void
onComplete()
void
onError(java.lang.Throwable t)
void
onNext(T item)
void
onSubscribe(org.reactivestreams.Subscription s)
void
subscribe(MultiSubscriber<? super T> downstream)
-
Methods inherited from class io.smallrye.mutiny.operators.multi.AbstractMultiOperator
upstream
-
Methods inherited from class io.smallrye.mutiny.operators.AbstractMulti
broadcast, cache, collect, convert, emitOn, group, ifNoItem, log, log, onCancellation, onCompletion, onFailure, onFailure, onFailure, onItem, onOverflow, onRequest, onSubscribe, onSubscription, onTermination, runSubscriptionOn, select, skip, subscribe, subscribe, toHotStream, toUni, withContext
-
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.Multi
attachContext, broadcast, cache, call, call, collect, concatMap, convert, emitOn, filter, flatMap, group, ifNoItem, invoke, invoke, log, log, map, onCancellation, onCompletion, onFailure, onFailure, onFailure, onItem, onOverflow, onRequest, onSubscribe, onSubscription, onTermination, plug, runSubscriptionOn, select, skip, stage, subscribe, toHotStream, toUni, withContext
-
-
-
-
Method Detail
-
subscribe
public void subscribe(MultiSubscriber<? super T> downstream)
- Overrides:
subscribe
in classAbstractMulti<T>
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
public void onError(java.lang.Throwable t)
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
context
public Context context()
Description copied from interface:ContextSupport
Provide a context.Since calls to this method shall only be triggered when a Mutiny pipeline uses a
withContext
operator, 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
withContext
operator.- Specified by:
context
in interfaceContextSupport
- Returns:
- the context, must not be
null
.
-
-