Class QueueDrainObserver<T,U,V>
- java.lang.Object
-
- io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberPad0
-
- io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberWip
-
- io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberPad2
-
- io.reactivex.rxjava3.internal.observers.QueueDrainObserver<T,U,V>
-
- Type Parameters:
T- the source type to which this subscriber will be subscribedU- the value type in the queueV- the value type the child subscriber accepts
- All Implemented Interfaces:
Observer<T>,ObservableQueueDrain<U,V>
- Direct Known Subclasses:
ObservableBufferExactBoundary.BufferExactBoundaryObserver,ObservableBufferTimed.BufferExactBoundedObserver,ObservableBufferTimed.BufferExactUnboundedObserver,ObservableBufferTimed.BufferSkipBoundedObserver
public abstract class QueueDrainObserver<T,U,V> extends QueueDrainSubscriberPad2 implements Observer<T>, ObservableQueueDrain<U,V>
Abstract base class for subscribers that hold another subscriber, a queue and requires queue-drain behavior.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancancelledprotected booleandoneprotected Observer<? super V>downstreamprotected java.lang.Throwableerrorprotected SimplePlainQueue<U>queue-
Fields inherited from class io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberPad2
p10a, p11a, p12a, p13a, p14a, p15a, p1a, p2a, p3a, p4a, p5a, p6a, p7a, p8a, p9a
-
Fields inherited from class io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberWip
wip
-
-
Constructor Summary
Constructors Constructor Description QueueDrainObserver(Observer<? super V> actual, SimplePlainQueue<U> queue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Observer<? super V> a, U v)Accept the value and return true if forwarded.booleancancelled()booleandone()booleanenter()java.lang.Throwableerror()protected voidfastPathEmit(U value, boolean delayError, Disposable dispose)protected voidfastPathOrderedEmit(U value, boolean delayError, Disposable disposable)Makes sure the fast-path emits in order.intleave(int m)Adds m to the wip counter.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.reactivex.rxjava3.core.Observer
onComplete, onError, onNext, onSubscribe
-
-
-
-
Field Detail
-
queue
protected final SimplePlainQueue<U> queue
-
cancelled
protected volatile boolean cancelled
-
done
protected volatile boolean done
-
error
protected java.lang.Throwable error
-
-
Constructor Detail
-
QueueDrainObserver
public QueueDrainObserver(Observer<? super V> actual, SimplePlainQueue<U> queue)
-
-
Method Detail
-
cancelled
public final boolean cancelled()
- Specified by:
cancelledin interfaceObservableQueueDrain<T,U>
-
done
public final boolean done()
- Specified by:
donein interfaceObservableQueueDrain<T,U>
-
enter
public final boolean enter()
- Specified by:
enterin interfaceObservableQueueDrain<T,U>
-
fastPathEmit
protected final void fastPathEmit(U value, boolean delayError, Disposable dispose)
-
fastPathOrderedEmit
protected final void fastPathOrderedEmit(U value, boolean delayError, Disposable disposable)
Makes sure the fast-path emits in order.- Parameters:
value- the value to emit or queue updelayError- if true, errors are delayed until the source has terminateddisposable- the resource to dispose if the drain terminates
-
error
public final java.lang.Throwable error()
- Specified by:
errorin interfaceObservableQueueDrain<T,U>
-
leave
public final int leave(int m)
Description copied from interface:ObservableQueueDrainAdds m to the wip counter.- Specified by:
leavein interfaceObservableQueueDrain<T,U>- Parameters:
m- the value to add- Returns:
- the wip value after adding the value
-
accept
public void accept(Observer<? super V> a, U v)
Description copied from interface:ObservableQueueDrainAccept the value and return true if forwarded.- Specified by:
acceptin interfaceObservableQueueDrain<T,U>- Parameters:
a- the subscriber to deliver values tov- the value to deliver
-
-