Class MultiOnTerminate<T>

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

public class MultiOnTerminate<T> extends Object
  • Constructor Details

    • MultiOnTerminate

      public MultiOnTerminate(Multi<T> upstream)
  • Method Details

    • invoke

      @CheckReturnValue public Multi<T> invoke(BiConsumer<Throwable,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(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(BiFunction<Throwable,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(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