Package io.smallrye.mutiny.groups
Class UniOnTerminate<T>
- java.lang.Object
-
- io.smallrye.mutiny.groups.UniOnTerminate<T>
-
public class UniOnTerminate<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description UniOnTerminate(Uni<T> upstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Uni<T>
call(Functions.Function3<? super T,java.lang.Throwable,java.lang.Boolean,Uni<?>> mapper)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.Uni<T>
call(java.util.function.Supplier<Uni<?>> supplier)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.Uni<T>
invoke(Functions.TriConsumer<T,java.lang.Throwable,java.lang.Boolean> consumer)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.Uni<T>
invoke(java.lang.Runnable action)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.
-
-
-
Method Detail
-
invoke
@CheckReturnValue public Uni<T> invoke(Functions.TriConsumer<T,java.lang.Throwable,java.lang.Boolean> consumer)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.- Parameters:
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 benull
in this case). Must not benull
If the second parameter (the failure) is notnull
, the first is necessarynull
and the third is necessaryfalse
as it indicates a termination due to a failure.- Returns:
- the new
Uni
-
invoke
@CheckReturnValue public Uni<T> invoke(java.lang.Runnable action)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription. Unlikeinvoke(Functions.TriConsumer)
(Functions.TriConsumer)}, the callback does not receive the item, failure or cancellation.- Parameters:
action
- the action to run, must not benull
- Returns:
- the new
Uni
-
call
@CheckReturnValue public Uni<T> call(Functions.Function3<? super T,java.lang.Throwable,java.lang.Boolean,Uni<?>> mapper)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription.- Parameters:
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 isnull
and the boolean isfalse
. When a failure is emitted then the item isnull
and the boolean isfalse
. When the subscription has been cancelled then the boolean istrue
and the other parameters arenull
. The function must return a non-null
Uni
.- Returns:
- the new
Uni
-
call
@CheckReturnValue public Uni<T> call(java.util.function.Supplier<Uni<?>> supplier)
Attaches an action that is executed when theUni
emits an item or a failure or when the subscriber cancels the subscription. Unlikecall(Functions.Function3)
the supplier does not receive the item, failure or cancellation.
-
-