public class MultiEmitterProcessor<T> extends Object implements org.reactivestreams.Processor<T,T>, MultiEmitter<T>
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Emits a
completion event downstream indicating that no more item will be sent. |
static <T> MultiEmitterProcessor<T> |
create() |
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 |
onComplete() |
void |
onError(Throwable failure) |
void |
onNext(T item) |
void |
onSubscribe(org.reactivestreams.Subscription subscription) |
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() |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber) |
Multi<T> |
toMulti() |
public static <T> MultiEmitterProcessor<T> create()
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>public void subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
subscribe in interface org.reactivestreams.Publisher<T>public void onSubscribe(org.reactivestreams.Subscription subscription)
onSubscribe in interface org.reactivestreams.Subscriber<T>public void onNext(T item)
onNext in interface org.reactivestreams.Subscriber<T>public void onError(Throwable failure)
onError in interface org.reactivestreams.Subscriber<T>public void onComplete()
onComplete in interface org.reactivestreams.Subscriber<T>Copyright © 2019–2020 SmallRye. All rights reserved.