T - the type of itempublic class SerializedMultiEmitter<T> extends Object implements MultiEmitter<T>, MultiSubscriber<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() |
void |
onCompletion()
Method called when the upstream emits a
completion terminal event. |
void |
onFailure(Throwable failure)
Method called when the upstream emits a
failure terminal event. |
void |
onItem(T item)
Method called when the upstream emits an
item event, in response to to requests to
Subscription.request(long). |
void |
onSubscribe(org.reactivestreams.Subscription s) |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonComplete, onError, onNextpublic void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe in interface org.reactivestreams.Subscriber<T>public void onItem(T item)
MultiSubscriberitem event, in response to to requests to
Subscription.request(long).onItem in interface MultiSubscriber<T>item - the item, must not be null.public void onFailure(Throwable failure)
MultiSubscriberfailure terminal event.
No further events will be sent even if Subscription.request(long) is invoked again.
onFailure in interface MultiSubscriber<T>failure - the failure, must not be null.public void onCompletion()
MultiSubscribercompletion terminal event.
No further events will be sent even if Subscription.request(long) is invoked again.
onCompletion in interface MultiSubscriber<T>public MultiEmitter<T> emit(T item)
MultiEmitteritem event downstream.
Calling this method after a failure or a completion events has no effect.
emit in interface MultiEmitter<T>item - the item, must not be nullpublic void fail(Throwable failure)
MultiEmitterfailure event downstream with the given exception.
Calling this method multiple times or after the MultiEmitter.complete() method has no effect.
fail in interface MultiEmitter<T>failure - the exception, must not be nullpublic void complete()
MultiEmittercompletion event downstream indicating that no more item will be sent.
Calling this method multiple times or after the MultiEmitter.fail(Throwable) method has no effect.
complete in interface MultiEmitter<T>public MultiEmitter<T> onTermination(Runnable onTermination)
MultiEmitterSubscription 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 in interface MultiEmitter<T>onTermination - the action to run on termination, must not be nullpublic boolean isCancelled()
isCancelled in interface MultiEmitter<T>true if the downstream cancelled the stream or the emitter was terminated (with a completion
or failure events).public long requested()
requested in interface MultiEmitter<T>Copyright © 2019–2020 SmallRye. All rights reserved.