Class 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 the Uni 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 the Uni 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 the Uni 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 the Uni emits an item or a failure or when the subscriber cancels the subscription.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UniOnTerminate

        public UniOnTerminate​(Uni<T> upstream)
    • 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 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​(java.lang.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,​java.lang.Throwable,​java.lang.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​(java.util.function.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