Package io.smallrye.mutiny.helpers
Class EmptyUniSubscription
- java.lang.Object
-
- io.smallrye.mutiny.helpers.EmptyUniSubscription
-
- All Implemented Interfaces:
Cancellable,UniSubscription,org.reactivestreams.Subscription
public class EmptyUniSubscription extends java.lang.Object implements UniSubscription
An implementation ofUniSubscriptionignoring all call tocancel(). This implementation should be accessed using theCANCELLEDinstance.
-
-
Field Summary
Fields Modifier and Type Field Description static UniSubscriptionCANCELLEDA subscription that has been cancelled.static UniSubscriptionDONEA subscription that has been done.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Requests theUnito cancel and clean up resources.static <T> voidpropagateFailureEvent(UniSubscriber<T> subscriber, java.lang.Throwable failure)Propagates a failure to the given downstream subscriber.-
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.UniSubscription
request
-
-
-
-
Field Detail
-
CANCELLED
public static final UniSubscription CANCELLED
A subscription that has been cancelled. The instance that can be shared. Callingcancel()is a no-op.
-
DONE
public static final UniSubscription DONE
A subscription that has been done. The instance that can be shared. Callingcancel()is a no-op.
-
-
Method Detail
-
propagateFailureEvent
public static <T> void propagateFailureEvent(UniSubscriber<T> subscriber, java.lang.Throwable failure)
Propagates a failure to the given downstream subscriber. The subscriber receive theCANCELLEDsubscription followed with the failure.- Type Parameters:
T- the expected item type- Parameters:
subscriber- the subscriber, must not benullfailure- the failure, must not benull
-
cancel
public void cancel()
Description copied from interface:UniSubscriptionRequests theUnito cancel and clean up resources. If the item is retrieved after cancellation, it is not forwarded to the subscriber. If the cancellation happens after the delivery of the item, this call is ignored.Calling this method, emits the
cancellationevent upstream.- Specified by:
cancelin interfaceCancellable- Specified by:
cancelin interfaceorg.reactivestreams.Subscription- Specified by:
cancelin interfaceUniSubscription
-
-