T - the expected type of itempublic interface UniSubscriber<T>
onSubscribe(UniSubscription) once after passing an instance of this UniSubscriber
to UniSubscribe.withSubscriber(UniSubscriber) retrieved from Uni.subscribe().
Unlike Reactive Streams Subscriber, UniSubscriber does not request items.
After subscription, it can receive:
onItem(Object). The item can be null.onFailure(Throwable) which signals an error state.Once this subscriber receives an item or failure event, no more events will be received.
Note that unlike in Reactive Streams, the value received in onItem(Object) can be null.
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(Throwable failure)
Called if the computation of the item by the subscriber
Uni failed. |
void |
onItem(T item)
Event handler called once the item has been computed by the subscribed
Uni. |
void |
onSubscribe(UniSubscription subscription)
Event handler called once the subscribed
Uni has taken into account the subscription. |
void onSubscribe(UniSubscription subscription)
Uni has taken into account the subscription. The Uni
have triggered the computation of the item.
IMPORTANT: onItem(Object) and onFailure(Throwable) would not be called
before the invocation of this method.
Uni.runSubscriptionOn(Executor) has been
calledonItem(Object) and
onFailure(Throwable) won't be calledsubscription - the subscription allowing to cancel the computation.void onItem(T item)
Uni.
IMPORTANT: this method will be only called once per subscription. If
onFailure(Throwable) is called, this method won't be called.
Uni.emitOn(java.util.concurrent.Executor) has been calleditem - the item, may be null.void onFailure(Throwable failure)
Uni failed.
IMPORTANT: this method will be only called once per subscription. If
onItem(Object) is called, this method won't be called.
Uni.emitOn(java.util.concurrent.Executor) has been calledfailure - the failure, cannot be null.Copyright © 2019–2020 SmallRye. All rights reserved.