T - the expected type of items.public interface MultiEmitter<T>
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Emits a
completion event downstream indicating that no more item will be sent. |
MultiEmitter<T> |
emit(T item)
Emits an
item event downstream. |
void |
fail(Throwable failure)
Emits a
failure event downstream with the given exception. |
boolean |
isCancelled() |
MultiEmitter<T> |
onTermination(Runnable onTermination)
Attaches a @{code termination} event handler invoked when the downstream
Subscription is cancelled,
or when the emitter has emitted either a completion or failure event. |
long |
requested() |
MultiEmitter<T> emit(T item)
item event downstream.
Calling this method after a failure or a completion events has no effect.
item - the item, must not be nullvoid fail(Throwable failure)
failure event downstream with the given exception.
Calling this method multiple times or after the complete() method has no effect.
failure - the exception, must not be nullvoid complete()
completion event downstream indicating that no more item will be sent.
Calling this method multiple times or after the fail(Throwable) method has no effect.
MultiEmitter<T> onTermination(Runnable onTermination)
Subscription is cancelled,
or when the emitter has emitted either a completion 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 nullboolean isCancelled()
true if the downstream cancelled the stream or the emitter was terminated (with a completion
or failure events).long requested()
Copyright © 2019–2020 SmallRye. All rights reserved.