- Type Parameters:
T- the expected type of item.
- All Superinterfaces:
ContextSupport
-
Method Summary
Modifier and TypeMethodDescriptionvoidEmits theitemevent downstream with the given (potentiallynull) item.voidEmits thefailureevent downstream with the given exception.onTermination(Runnable onTermination) Attaches a @{code termination} event handler invoked when the downstreamUniSubscriptionis cancelled, or when the emitter has emitted either anitemorfailureevent.Methods inherited from interface io.smallrye.mutiny.subscription.ContextSupport
context
-
Method Details
-
complete
Emits theitemevent downstream with the given (potentiallynull) item.Calling this method multiple times or after the
fail(Throwable)method has no effect.- Parameters:
item- the item, may benull
-
fail
Emits thefailureevent downstream with the given exception.Calling this method multiple times or after the
complete(Object)method has no effect.- Parameters:
failure- the exception, must not benull
-
onTermination
Attaches a @{code termination} event handler invoked when the downstreamUniSubscriptionis cancelled, or when the emitter has emitted either anitemorfailureevent.This method allows cleanup resources once the emitter can be disposed (has reached a terminal state).
If the registration of the
onTerminationcallback is done after the termination, it invokes the callback immediately.- Parameters:
onTermination- the action to run on termination, must not benull- Returns:
- this emitter
-