T - the expected type of item.public interface UniEmitter<T>
| Modifier and Type | Method and Description |
|---|---|
void |
complete(T item)
Emits the
item event downstream with the given (potentially null) item. |
void |
fail(Throwable failure)
Emits the
failure event downstream with the given exception. |
UniEmitter<T> |
onTermination(Runnable onTermination)
Attaches a @{code termination} event handler invoked when the downstream
UniSubscription is cancelled,
or when the emitter has emitted either an item or failure event. |
void complete(T item)
item event downstream with the given (potentially null) item.
Calling this method multiple times or after the fail(Throwable) method has no effect.
item - the item, may be nullvoid fail(Throwable failure)
failure event downstream with the given exception.
Calling this method multiple times or after the complete(Object) method has no effect.
failure - the exception, must not be nullUniEmitter<T> onTermination(Runnable onTermination)
UniSubscription is cancelled,
or when the emitter has emitted either an item or failure event.
This method allows cleanup resources once the emitter can be disposed (has reached a terminal state).
onTermination - the action to run on termination, must not be nullCopyright © 2019–2020 SmallRye. All rights reserved.