Class MultiOnCancel<T>

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

public class MultiOnCancel<T> extends Object
  • Constructor Details

    • MultiOnCancel

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

    • invoke

      @CheckReturnValue public Multi<T> invoke(Runnable action)
      Attaches an action executed when the subscription is cancelled. The upstream is not cancelled yet, but will be cancelled when the callback completes. Note that if the callback throws an exception then it will be discarded.
      Parameters:
      action - the action, must not be null
      Returns:
      a new Multi
    • call

      @CheckReturnValue public Multi<T> call(Supplier<Uni<?>> supplier)
      Attaches an action executed when the subscription is cancelled. The upstream is not cancelled yet, but will be cancelled when the returned Uni completes. The supplier must not return null. Note that the result or the failure of the Uni will be discarded.
      Parameters:
      supplier - the Uni supplier, must not return null.
      Returns:
      a new Multi