Class MultiOnCompletion<T>


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Multi<T> call​(java.util.function.Supplier<Uni<?>> supplier)
      Creates a new Multi executing the given Uni action when this Multi completes.
      Multi<T> continueWith​(java.lang.Iterable<T> items)
      When the upstream Multi completes, continue with the given items.
      Multi<T> continueWith​(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> supplier)
      When the upstream Multi completes, continue with the items produced by the given Supplier.
      Multi<T> continueWith​(T... items)
      When the upstream Multi completes, continue with the given items.
      Multi<T> fail()
      Like failWith(Throwable) but using a NoSuchElementException.
      Multi<T> failWith​(java.lang.Throwable failure)
      When the current Multi completes, the passed failure is sent downstream.
      Multi<T> failWith​(java.util.function.Supplier<java.lang.Throwable> supplier)
      When the current Multi completes, a failure produced by the given Supplier is sent downstream.
      MultiIfEmpty<T> ifEmpty()  
      Multi<T> invoke​(java.lang.Runnable action)
      Creates a new Multi executing the given action when this Multi completes.
      Multi<T> switchTo​(java.util.function.Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
      When the upstream Multi completes, it continues with the events fired by a Publisher produces with the given Supplier.
      Multi<T> switchTo​(org.reactivestreams.Publisher<? extends T> other)
      When the upstream Multi completes, it continues with the events fired by the passed Publisher / Multi.
      Multi<T> switchToEmitter​(java.util.function.Consumer<MultiEmitter<? super T>> consumer)
      When the upstream Multi completes, it continues with the events fired with the emitter passed to the consumer callback.
      • Methods inherited from class java.lang.Object

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

      • MultiOnCompletion

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

      • invoke

        @CheckReturnValue
        public Multi<T> invoke​(java.lang.Runnable action)
        Creates a new Multi executing the given action when this Multi completes.
        Parameters:
        action - the action, must not be null
        Returns:
        the new Multi
      • call

        @CheckReturnValue
        public Multi<T> call​(java.util.function.Supplier<Uni<?>> supplier)
        Creates a new Multi executing the given Uni action when this Multi completes. The completion notification is sent downstream when the Uni has completed.
        Parameters:
        supplier - the supplier, must return a non-null Uni
        Returns:
        the new Multi
      • failWith

        @CheckReturnValue
        public Multi<T> failWith​(java.lang.Throwable failure)
        When the current Multi completes, the passed failure is sent downstream.
        Parameters:
        failure - the failure
        Returns:
        the new Multi
      • failWith

        @CheckReturnValue
        public Multi<T> failWith​(java.util.function.Supplier<java.lang.Throwable> supplier)
        When the current Multi completes, a failure produced by the given Supplier is sent downstream.
        Parameters:
        supplier - the supplier to produce the failure, must not be null, must not produce null
        Returns:
        the new Multi
      • switchToEmitter

        @CheckReturnValue
        public Multi<T> switchToEmitter​(java.util.function.Consumer<MultiEmitter<? super T>> consumer)
        When the upstream Multi completes, it continues with the events fired with the emitter passed to the consumer callback.

        If the upstream Multi fails, the switch does not apply.

        Parameters:
        consumer - the callback receiving the emitter to fire the events. Must not be null. Throwing exception in this function propagates a failure downstream.
        Returns:
        the new Multi
      • switchTo

        @CheckReturnValue
        public Multi<T> switchTo​(org.reactivestreams.Publisher<? extends T> other)
        When the upstream Multi completes, it continues with the events fired by the passed Publisher / Multi.

        If the upstream Multi fails, the switch does not apply.

        Parameters:
        other - the stream to switch to when the upstream completes.
        Returns:
        the new Multi
      • switchTo

        @CheckReturnValue
        public Multi<T> switchTo​(java.util.function.Supplier<org.reactivestreams.Publisher<? extends T>> supplier)
        When the upstream Multi completes, it continues with the events fired by a Publisher produces with the given Supplier.
        Parameters:
        supplier - the supplier to use to produce the publisher, must not be null, must not return nulls
        Returns:
        the new Uni
      • continueWith

        @SafeVarargs
        @CheckReturnValue
        public final Multi<T> continueWith​(T... items)
        When the upstream Multi completes, continue with the given items.
        Parameters:
        items - the items, must not be null, must not contain null
        Returns:
        the new Multi
      • continueWith

        @CheckReturnValue
        public Multi<T> continueWith​(java.lang.Iterable<T> items)
        When the upstream Multi completes, continue with the given items.
        Parameters:
        items - the items, must not be null, must not contain null
        Returns:
        the new Multi
      • continueWith

        @CheckReturnValue
        public Multi<T> continueWith​(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> supplier)
        When the upstream Multi completes, continue with the items produced by the given Supplier.
        Parameters:
        supplier - the supplier to produce the items, must not be null, must not produce null
        Returns:
        the new Multi