Class MultiOnTerminate<T>


  • public class MultiOnTerminate<T>
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Multi<T> call​(java.util.function.BiFunction<java.lang.Throwable,​java.lang.Boolean,​Uni<?>> mapper)
      Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
      Multi<T> call​(java.util.function.Supplier<Uni<?>> supplier)
      Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
      Multi<T> invoke​(java.lang.Runnable action)
      Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
      Multi<T> invoke​(java.util.function.BiConsumer<java.lang.Throwable,​java.lang.Boolean> callback)
      Attaches an action that is executed when the Multi emits a completion 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

      • MultiOnTerminate

        public MultiOnTerminate​(Multi<T> upstream)
    • Method Detail

      • invoke

        @CheckReturnValue
        public Multi<T> invoke​(java.util.function.BiConsumer<java.lang.Throwable,​java.lang.Boolean> callback)
        Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
        Parameters:
        callback - the consumer receiving the failure if any and a boolean indicating whether the termination is due to a cancellation (the failure parameter would be null in this case). Must not be null.
        Returns:
        the new Multi
      • invoke

        @CheckReturnValue
        public Multi<T> invoke​(java.lang.Runnable action)
        Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription. Unlike invoke(BiConsumer), the callback does not receive the failure or cancellation details.
        Parameters:
        action - the action to execute when the streams completes, fails or the subscription gets cancelled. Must not be null.
        Returns:
        the new Multi
      • call

        @CheckReturnValue
        public Multi<T> call​(java.util.function.BiFunction<java.lang.Throwable,​java.lang.Boolean,​Uni<?>> mapper)
        Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
        Parameters:
        mapper - the function to execute where the first argument is a non-null exception on failure, and the second argument is a boolean which is true when the subscriber cancels the subscription. The function returns a Uni and must not be null.
        Returns:
        the new Multi
      • call

        @CheckReturnValue
        public Multi<T> call​(java.util.function.Supplier<Uni<?>> supplier)
        Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription.
        Parameters:
        supplier - the supplier returns a Uni and must not be null.
        Returns:
        the new Multi