Class QueueDrainSubscriber<T,U,V>

Type Parameters:
T - the source type to which this subscriber will be subscribed
U - the value type in the queue
V - the value type the child subscriber accepts
All Implemented Interfaces:
FlowableSubscriber<T>, QueueDrain<U,V>, org.reactivestreams.Subscriber<T>
Direct Known Subclasses:
FlowableBufferExactBoundary.BufferExactBoundarySubscriber, FlowableBufferTimed.BufferExactBoundedSubscriber, FlowableBufferTimed.BufferExactUnboundedSubscriber, FlowableBufferTimed.BufferSkipBoundedSubscriber

public abstract class QueueDrainSubscriber<T,U,V> extends QueueDrainSubscriberPad4 implements FlowableSubscriber<T>, QueueDrain<U,V>
Abstract base class for subscribers that hold another subscriber, a queue and requires queue-drain behavior.
  • Field Details

    • downstream

      protected final org.reactivestreams.Subscriber<? super V> downstream
    • queue

      protected final SimplePlainQueue<U> queue
    • cancelled

      protected volatile boolean cancelled
    • done

      protected volatile boolean done
    • error

      protected Throwable error
  • Constructor Details

    • QueueDrainSubscriber

      public QueueDrainSubscriber(org.reactivestreams.Subscriber<? super V> actual, SimplePlainQueue<U> queue)
  • Method Details

    • cancelled

      public final boolean cancelled()
      Specified by:
      cancelled in interface QueueDrain<T,U>
    • done

      public final boolean done()
      Specified by:
      done in interface QueueDrain<T,U>
    • enter

      public final boolean enter()
      Specified by:
      enter in interface QueueDrain<T,U>
    • fastEnter

      public final boolean fastEnter()
    • fastPathEmitMax

      protected final void fastPathEmitMax(U value, boolean delayError, Disposable dispose)
    • fastPathOrderedEmitMax

      protected final void fastPathOrderedEmitMax(U value, boolean delayError, Disposable dispose)
    • accept

      public boolean accept(org.reactivestreams.Subscriber<? super V> a, U v)
      Description copied from interface: QueueDrain
      Accept the value and return true if forwarded.
      Specified by:
      accept in interface QueueDrain<T,U>
      Parameters:
      a - the subscriber
      v - the value
      Returns:
      true if the value was delivered
    • error

      public final Throwable error()
      Specified by:
      error in interface QueueDrain<T,U>
    • leave

      public final int leave(int m)
      Description copied from interface: QueueDrain
      Adds m to the wip counter.
      Specified by:
      leave in interface QueueDrain<T,U>
      Parameters:
      m - the value to add
      Returns:
      the current value after adding m
    • requested

      public final long requested()
      Specified by:
      requested in interface QueueDrain<T,U>
    • produced

      public final long produced(long n)
      Specified by:
      produced in interface QueueDrain<T,U>
    • requested

      public final void requested(long n)