public class UniOnTerminate<T> extends Object
| Constructor and Description |
|---|
UniOnTerminate(Uni<T> upstream) |
| Modifier and Type | Method and Description |
|---|---|
Uni<T> |
invoke(Functions.TriConsumer<T,Throwable,Boolean> consumer)
Attaches an action that is executed when the
Uni emits an item or a failure or when the subscriber
cancels the subscription. |
Uni<T> |
invoke(Runnable action)
Attaches an action that is executed when the
Uni emits an item or a failure or when the subscriber
cancels the subscription. |
Uni<T> |
invokeUni(Functions.Function3<? super T,Throwable,Boolean,Uni<?>> mapper)
Attaches an action that is executed when the
Uni emits an item or a failure or when the subscriber
cancels the subscription. |
Uni<T> |
invokeUni(Supplier<Uni<?>> supplier)
Attaches an action that is executed when the
Uni emits an item or a failure or when the subscriber
cancels the subscription. |
public Uni<T> invoke(Functions.TriConsumer<T,Throwable,Boolean> consumer)
Uni emits an item or a failure or when the subscriber
cancels the subscription.consumer - the consumer receiving the item, the failure and a boolean indicating whether the termination
is due to a cancellation (the 2 first parameters would be null in this case). Must not
be null If the second parameter (the failure) is not null, the first is
necessary null and the third is necessary false as it indicates a termination
due to a failure.Unipublic Uni<T> invoke(Runnable action)
Uni emits an item or a failure or when the subscriber
cancels the subscription. Unlike invoke(Functions.TriConsumer) (Functions.TriConsumer)}, the callback does not
receive
the item, failure or cancellation.action - the action to run, must not be nullUnipublic Uni<T> invokeUni(Functions.Function3<? super T,Throwable,Boolean,Uni<?>> mapper)
Uni emits an item or a failure or when the subscriber
cancels the subscription.mapper - the function receiving the item, the failure and a boolean indicating whether the termination
is due to a cancellation. When an item is emitted then the failure is null and the boolean
is false. When a failure is emitted then the item is null and the boolean
is false. When the subscription has been cancelled then the boolean is true and the
other parameters are null.
The function must return a non-null Uni.UniCopyright © 2019–2020 SmallRye. All rights reserved.