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 theUniemits 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 theUniemits 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 theUniemits 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 theUniemits an item or a failure or when the subscriber cancels the subscription.
-
-
-
Method Detail
-
invoke
public Uni<T> invoke(Functions.TriConsumer<T,java.lang.Throwable,java.lang.Boolean> consumer)
Attaches an action that is executed when theUniemits 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 benullin this case). Must not benullIf the second parameter (the failure) is notnull, the first is necessarynulland the third is necessaryfalseas it indicates a termination due to a failure.- Returns:
- the new
Uni
-
invoke
public Uni<T> invoke(java.lang.Runnable action)
Attaches an action that is executed when theUniemits 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
public Uni<T> call(Functions.Function3<? super T,java.lang.Throwable,java.lang.Boolean,Uni<?>> mapper)
Attaches an action that is executed when theUniemits 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 isnulland the boolean isfalse. When a failure is emitted then the item isnulland the boolean isfalse. When the subscription has been cancelled then the boolean istrueand the other parameters arenull. The function must return a non-nullUni.- Returns:
- the new
Uni
-
call
public Uni<T> call(java.util.function.Supplier<Uni<?>> supplier)
Attaches an action that is executed when theUniemits an item or a failure or when the subscriber cancels the subscription. Unlikecall(Supplier)(Functions.Function3)} the supplier does not receive the item, failure or cancellation.
-
-