Class DelayedSubscriber<T>

java.lang.Object
io.micronaut.core.async.publisher.DelayedSubscriber<T>
Type Parameters:
T - The forwarded type
All Implemented Interfaces:
org.reactivestreams.Processor<T,T>, org.reactivestreams.Publisher<T>, org.reactivestreams.Subscriber<T>, org.reactivestreams.Subscription

@Internal public final class DelayedSubscriber<T> extends Object implements org.reactivestreams.Processor<T,T>, org.reactivestreams.Subscription
This is a Processor that does not change the stream, but allows the upstream Publisher and downstream Subscriber to be set independently in any order. If the upstream is set first, this class makes sure that any early completion is held back until the downstream has finished onSubscribe. If the downstream is set first, this class makes sure any demand is stored until the upstream becomes available.
Since:
4.4.0
  • Constructor Details

    • DelayedSubscriber

      public DelayedSubscriber()
  • Method Details

    • subscribe

      public void subscribe(org.reactivestreams.Subscriber<? super T> s)
      Specified by:
      subscribe in interface org.reactivestreams.Publisher<T>
    • onSubscribe

      public void onSubscribe(org.reactivestreams.Subscription s)
      Specified by:
      onSubscribe in interface org.reactivestreams.Subscriber<T>
    • onNext

      public void onNext(T t)
      Specified by:
      onNext in interface org.reactivestreams.Subscriber<T>
    • onError

      public void onError(Throwable t)
      Specified by:
      onError in interface org.reactivestreams.Subscriber<T>
    • onComplete

      public void onComplete()
      Specified by:
      onComplete in interface org.reactivestreams.Subscriber<T>
    • request

      public void request(long n)
      Specified by:
      request in interface org.reactivestreams.Subscription
    • cancel

      public void cancel()
      Specified by:
      cancel in interface org.reactivestreams.Subscription