Class UniOnTerminate<T>

java.lang.Object
io.smallrye.mutiny.groups.UniOnTerminate<T>

public class UniOnTerminate<T> extends Object
  • Constructor Details

    • UniOnTerminate

      public UniOnTerminate(Uni<T> upstream)
  • Method Details

    • invoke

      @CheckReturnValue public 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.
      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 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.
      Returns:
      the new Uni
    • invoke

      @CheckReturnValue public 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. Unlike invoke(Functions.TriConsumer) (Functions.TriConsumer)}, the callback does not receive the item, failure or cancellation.
      Parameters:
      action - the action to run, must not be null
      Returns:
      the new Uni
    • call

      @CheckReturnValue public Uni<T> call(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.
      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 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.
      Returns:
      the new Uni
    • call

      @CheckReturnValue public Uni<T> call(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. Unlike call(Functions.Function3) the supplier does not receive the item, failure or cancellation.
      Parameters:
      supplier - must return a non-null Uni.
      Returns:
      the new Uni