public class BufferItemMultiEmitter<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected MultiSubscriber<? super T> |
downstream |
protected AtomicLong |
requested |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
complete()
Emits a
completion event downstream indicating that no more item will be sent. |
void |
completion() |
MultiEmitter<T> |
emit(T t)
Emits an
item event downstream. |
void |
fail(Throwable failure)
Emits a
failure event downstream with the given exception. |
void |
failed(Throwable failure) |
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. |
void |
request(long n) |
long |
requested() |
MultiEmitter<T> |
serialize() |
protected final AtomicLong requested
protected final MultiSubscriber<? super T> downstream
public MultiEmitter<T> emit(T t)
MultiEmitteritem event downstream.
Calling this method after a failure or a completion events has no effect.
t - the item, must not be nullpublic void failed(Throwable failure)
public void completion()
public long requested()
requested in interface MultiEmitter<T>public 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 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 final 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 final void cancel()
cancel in interface org.reactivestreams.Subscriptionpublic final void request(long n)
request in interface org.reactivestreams.Subscriptionpublic 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 MultiEmitter<T> serialize()
Copyright © 2019–2020 SmallRye. All rights reserved.