Class MultiSubscriberAdapter<T>

java.lang.Object
io.smallrye.mutiny.subscription.MultiSubscriberAdapter<T>
Type Parameters:
T - the elements type
All Implemented Interfaces:
ContextSupport, MultiSubscriber<T>, Flow.Subscriber<T>

public class MultiSubscriberAdapter<T> extends Object implements MultiSubscriber<T>, ContextSupport
Thin adapter of a Flow.Subscriber to a Mutiny MultiSubscriber.
  • Constructor Details

    • MultiSubscriberAdapter

      public MultiSubscriberAdapter(Flow.Subscriber<? super T> downstream)
  • Method Details

    • onSubscribe

      public void onSubscribe(Flow.Subscription subscription)
      Specified by:
      onSubscribe in interface Flow.Subscriber<T>
    • onItem

      public void onItem(T item)
      Description copied from interface: MultiSubscriber
      Method called when the upstream emits an item event, in response to to requests to Flow.Subscription.request(long).
      Specified by:
      onItem in interface MultiSubscriber<T>
      Parameters:
      item - the item, must not be null.
    • onFailure

      public void onFailure(Throwable failure)
      Description copied from interface: MultiSubscriber
      Method called when the upstream emits a failure terminal event.

      No further events will be sent even if Flow.Subscription.request(long) is invoked again.

      Specified by:
      onFailure in interface MultiSubscriber<T>
      Parameters:
      failure - the failure, must not be null.
    • onCompletion

      public void onCompletion()
      Description copied from interface: MultiSubscriber
      Method called when the upstream emits a completion terminal event.

      No further events will be sent even if Flow.Subscription.request(long) is invoked again.

      Specified by:
      onCompletion in interface MultiSubscriber<T>
    • context

      public Context context()
      Description copied from interface: ContextSupport
      Provide a context.

      Since calls to this method shall only be triggered when a Mutiny pipeline uses a withContext operator, there is no need in general for caching the context value in a field of the implementing class. Exceptions include operators that have cross-subscriber semantics such as memoizers or broadcasters.

      This method is expected to be called once per withContext operator.

      Specified by:
      context in interface ContextSupport
      Returns:
      the context, must not be null.