T - the type of item emitted by the emitterpublic class DefaultUniEmitter<T> extends Object implements UniEmitter<T>, UniSubscription
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Requests the
Uni to cancel and clean up resources. |
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. |
boolean |
isTerminated() |
UniEmitter<T> |
onTermination(Runnable callback)
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequestpublic void complete(T item)
UniEmitteritem event downstream with the given (potentially null) item.
Calling this method multiple times or after the UniEmitter.fail(Throwable) method has no effect.
complete in interface UniEmitter<T>item - the item, may be nullpublic void fail(Throwable failure)
UniEmitterfailure event downstream with the given exception.
Calling this method multiple times or after the UniEmitter.complete(Object) method has no effect.
fail in interface UniEmitter<T>failure - the exception, must not be nullpublic UniEmitter<T> onTermination(Runnable callback)
UniEmitterUniSubscription 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 in interface UniEmitter<T>callback - the action to run on termination, must not be nullpublic void cancel()
UniSubscriptionUni to cancel and clean up resources.
If the item is retrieved after cancellation, it is not forwarded to the subscriber.
If the cancellation happens after the delivery of the item, this call is ignored.
Calling this method, emits the cancellation event upstream.
cancel in interface Cancellablecancel in interface UniSubscriptioncancel in interface org.reactivestreams.Subscriptionpublic boolean isTerminated()
Copyright © 2019–2020 SmallRye. All rights reserved.