Class MultiOnEvent<T>

  • Type Parameters:
    T - the type of item emitted by the Multi

    @Deprecated
    public class MultiOnEvent<T>
    extends java.lang.Object
    Deprecated.
    Use the specialized groups in Multi, e.g. Multi.onItem() or Multi.onSubscribe() instead
    Allows configuring the action to execute on each type of events emitted by a Multi or by a Subscriber
    • Constructor Detail

      • MultiOnEvent

        public MultiOnEvent​(Multi<T> upstream)
        Deprecated.
    • Method Detail

      • subscribed

        @Deprecated
        public Multi<T> subscribed​(java.util.function.Consumer<? super org.reactivestreams.Subscription> callback)
        Deprecated.
        Attaches an action executed when the Multi has received a Subscription from upstream. The downstream does not have received the subscription yet. It will be done once the action completes.

        This method is not intended to cancel the subscription. It's the responsibility of the subscriber to do so.

        Parameters:
        callback - the callback, must not be null
        Returns:
        a new Multi
      • cancellation

        @Deprecated
        public Multi<T> cancellation​(java.lang.Runnable callback)
        Deprecated.
        Attaches an action executed when a subscription is cancelled. The upstream is not cancelled yet, but will when the callback completes.
        Parameters:
        callback - the callback, must not be null
        Returns:
        a new Multi
      • request

        @Deprecated
        public Multi<T> request​(java.util.function.LongConsumer callback)
        Deprecated.
        Use Multi.onRequest() instead
        Action when items are being requested.
        Parameters:
        callback - the action
        Returns:
        a new Multi
      • overflow

        @Deprecated
        public MultiOverflow<T> overflow()
        Deprecated.
      • termination

        @Deprecated
        public Multi<T> termination​(java.util.function.BiConsumer<java.lang.Throwable,​java.lang.Boolean> callback)
        Deprecated.
        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
      • termination

        @Deprecated
        public Multi<T> termination​(java.lang.Runnable action)
        Deprecated.
        Attaches an action that is executed when the Multi emits a completion or a failure or when the subscriber cancels the subscription. Unlike termination(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
      • item

        @Deprecated
        public MultiOnItem<T> item()
        Deprecated.
        Use Multi.onItem() instead
        Configures the action to execute when the observed Multi emits an item.

        Examples:

         
         Multi<T> multi = ...;
         multi.onItem().apply(x -> ...); // Map to another item
         multi.onItem().mapToMulti(x -> ...); // Map to a multi
         
         
        Returns:
        the object to configure the action to execute when an item is emitted
      • failure

        @Deprecated
        public MultiOnFailure<T> failure()
        Deprecated.
        Use Multi.onFailure() instead
        Like failure(Predicate) but applied to all failures fired by the upstream multi. It allows configuring the on failure behavior (recovery, retry...).
        Returns:
        a MultiOnFailure on which you can specify the on failure action
      • completion

        @Deprecated
        public MultiOnCompletion<T> completion()
        Deprecated.
        Configures the action to execute when the observed Multi emits the completion event.
        Returns:
        the object to configure the action
      • failure

        @Deprecated
        public MultiOnFailure<T> failure​(java.util.function.Predicate<? super java.lang.Throwable> predicate)
        Deprecated.
        Configures a predicate filtering the failures on which the behavior (specified with the returned MultiOnFailure) is applied.

        For instance, to only when an IOException is fired as failure you can use: multi.onFailure(IOException.class).recoverWithItem("hello")

        The fallback value (hello) will only be used if the upstream multi fires a failure of type IOException.

        Parameters:
        predicate - the predicate, null means applied to all failures
        Returns:
        a MultiOnFailure configured with the given predicate on which you can specify the on failure action
      • failure

        @Deprecated
        public MultiOnFailure<T> failure​(java.lang.Class<? extends java.lang.Throwable> typeOfFailure)
        Deprecated.
        Configures a type of failure filtering the failures on which the behavior (specified with the returned MultiOnFailure) is applied.

        For instance, to only when an IOException is fired as failure you can use: multi.onFailure(IOException.class).recoverWithItem("hello")

        The fallback value (hello) will only be used if the upstream multi fire a failure of type IOException.*

        Parameters:
        typeOfFailure - the class of exception, must not be null
        Returns:
        a MultiOnFailure configured with the given predicate on which you can specify the on failure action
      • completion

        @Deprecated
        public Multi<T> completion​(java.lang.Runnable callback)
        Deprecated.
        Configures a callback when this Multi completes.
        Parameters:
        callback - the callback, must not be null
        Returns:
        the new Multi
      • subscribe

        @Deprecated
        public MultiOnSubscribe<T> subscribe()
        Deprecated.
        Configure actions when receiving a subscription.
        Returns:
        the object to configure the actions
      • cancellation

        @Deprecated
        public MultiOnCancel<T> cancellation()
        Deprecated.
        Configures actions when the subscription is cancelled.
        Returns:
        the object to configure the actions
      • termination

        @Deprecated
        public MultiOnTerminate<T> termination()
        Deprecated.
        Configures actions when the Multi terminates on either a completion, a failure or a cancellation.
        Returns:
        the object to configure the actions
      • request

        @Deprecated
        public MultiOnRequest<T> request()
        Deprecated.
        Use Multi.onRequest() instead
        Configures actions when items are being requested.
        Returns:
        the object to configure the actions