Package io.smallrye.mutiny.operators.uni
Class UniMemoizeOp<I>
- java.lang.Object
-
- io.smallrye.mutiny.operators.AbstractUni<O>
-
- io.smallrye.mutiny.operators.UniOperator<I,I>
-
- io.smallrye.mutiny.operators.uni.UniMemoizeOp<I>
-
- All Implemented Interfaces:
UniSubscriber<I>,Uni<I>
public class UniMemoizeOp<I> extends UniOperator<I,I> implements UniSubscriber<I>
-
-
Constructor Summary
Constructors Constructor Description UniMemoizeOp(Uni<? extends I> upstream)UniMemoizeOp(Uni<? extends I> upstream, java.util.function.BooleanSupplier invalidationRequested)
-
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.voidsubscribe(UniSubscriber<? super I> subscriber)-
Methods inherited from class io.smallrye.mutiny.operators.UniOperator
upstream
-
Methods inherited from class io.smallrye.mutiny.operators.AbstractUni
and, and, await, cache, convert, emitOn, ifNoItem, memoize, on, onCancellation, onFailure, onFailure, onFailure, onItem, onItemOrFailure, onSubscribe, onTermination, or, repeat, runSubscriptionOn, subscribe, subscribe, toMulti
-
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.Uni
call, call, chain, chain, eventually, eventually, flatMap, invoke, invoke, invokeUni, map, plug, replaceWith, replaceWith, replaceWith, replaceWithNull, stage, subscribeAsCompletionStage, then, then
-
-
-
-
Method Detail
-
subscribe
public void subscribe(UniSubscriber<? super I> subscriber)
- Specified by:
subscribein classAbstractUni<I>
-
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
-
-