Top Description Fields Constructors Methods
reactor.core.publisher

pack-priv abstract Class QueueDrainSubscriber<T, U, V>

Additional top-level classes in compilation unit: QueueDrainSubscriberPad0, QueueDrainSubscriberWip, QueueDrainSubscriberPad2, QueueDrainSubscriberPad3, QueueDrainSubscriberPad4.

extends QueueDrainSubscriberPad4
implements InnerOperator<T, V>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.InnerOperator, reactor.core.publisher.InnerProducer, org.reactivestreams.Subscription, reactor.core.Scannable, reactor.core.publisher.InnerConsumer, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber
Known Direct Subclasses
reactor.core.publisher.FluxWindowWhen.WindowWhenMainSubscriber
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
Imports
java.util.Queue, java.util.concurrent.atomic.AtomicInteger, .AtomicLongFieldUpdater, org.reactivestreams.Subscriber, reactor.core.CoreSubscriber, .Disposable, .Exceptions, reactor.util.annotation.Nullable

Abstract base class for subscribers that hold another subscriber, a queue and requires queue-drain behavior.
Authors
Simon Baslé, David Karnok

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super V>
pack-priv volatile boolean
pack-priv volatile boolean
pack-priv Throwable
pack-priv final Queue<U>
Inherited from reactor.core.publisher.QueueDrainSubscriberPad4:
pad000pad001pad002pad003pad004pad005pad006pad007pad010pad011pad012pad013pad014pad015pad016pad017pad020pad021pad022pad023pad024pad025pad026pad027pad030pad031pad032pad033pad034pad035pad036pad037pad040pad041pad042pad043pad044pad045pad046pad047pad050pad051pad052pad053pad054pad055pad056pad057pad060pad061pad062pad063pad064pad065pad066pad067pad070pad071pad072pad073pad074pad075pad076pad077pad100pad101pad102pad103pad104pad105pad106pad107pad110pad111pad112pad113pad114pad115pad116pad117pad120pad121pad122pad123pad124pad125pad126pad127pad130pad131pad132pad133pad134pad135pad136pad137pad140pad141pad142pad143pad144pad145pad146pad147pad150pad151pad152pad153pad154pad155pad156pad157pad160pad161pad162pad163pad164pad165pad166pad167pad170pad171pad172pad173pad174pad175pad176pad177

Constructor Summary

AccessConstructor and Description
pack-priv
QueueDrainSubscriber(CoreSubscriber<? super V> actual, Queue<U> queue)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the value was delivered
accept
(Subscriber<? super V>
the subscriber
a
,
U
the value
v
)

Accept the value and return true if forwarded.

public CoreSubscriber<? super V>
public final boolean
pack-priv static <Q, S> boolean
checkTerminated(boolean d, boolean empty, Subscriber<?> s, boolean delayError, Queue<?> q, QueueDrainSubscriber<?, Q, S> qd)

public final boolean
done()

pack-priv static <
the queue value type
Q
,
the emission value type
S
>
void
drainMaxLoop(Queue<Q>
the queue
q
,
Subscriber<? super S>
the subscriber
a
,
boolean
true if errors should be delayed after all normal items
delayError
,
Disposable
the disposable to call when termination happens and cleanup is necessary
dispose
,
QueueDrainSubscriber<?, Q, S>
the QueueDrain instance that gives status information to the drain logic
qd
)

Drain the queue but give up with an error if there aren't enough requests.

public final boolean
public final Throwable
public final boolean
protected final void
fastPathEmitMax(U value, boolean delayError, Disposable dispose)

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

public final int

Returns:

the current value after adding m
leave
(int
the value to add
m
)

Adds m to the wip counter.

public final long
produced(long n)

public final long
public final void
requested(long n)

public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super V> actual
cancelledback to summary
pack-priv volatile boolean cancelled
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
queueback to summary
pack-priv final Queue<U> queue

Constructor Detail

QueueDrainSubscriberback to summary
pack-priv QueueDrainSubscriber(CoreSubscriber<? super V> actual, Queue<U> queue)

Method Detail

acceptback to summary
public boolean accept(Subscriber<? super V> a, U v)

Accept the value and return true if forwarded.

Parameters
a:Subscriber<? super V>

the subscriber

v:U

the value

Returns:boolean

true if the value was delivered

actualback to summary
public CoreSubscriber<? super V> actual()

Implements reactor.core.publisher.InnerProducer.actual.

Annotations
@Override
cancelledback to summary
public final boolean cancelled()
checkTerminatedback to summary
pack-priv static <Q, S> boolean checkTerminated(boolean d, boolean empty, Subscriber<?> s, boolean delayError, Queue<?> q, QueueDrainSubscriber<?, Q, S> qd)
doneback to summary
public final boolean done()
drainMaxLoopback to summary
pack-priv static <Q, S> void drainMaxLoop(Queue<Q> q, Subscriber<? super S> a, boolean delayError, Disposable dispose, QueueDrainSubscriber<?, Q, S> qd)

Drain the queue but give up with an error if there aren't enough requests.

Parameters
<Q>
the queue value type
<S>
the emission value type
q:Queue<Q>

the queue

a:Subscriber<? super S>

the subscriber

delayError:boolean

true if errors should be delayed after all normal items

dispose:Disposable

the disposable to call when termination happens and cleanup is necessary

qd:QueueDrainSubscriber<?, Q, S>

the QueueDrain instance that gives status information to the drain logic

enterback to summary
public final boolean enter()
errorback to summary
public final Throwable error()
fastEnterback to summary
public final boolean fastEnter()
fastPathEmitMaxback to summary
protected final void fastPathEmitMax(U value, boolean delayError, Disposable dispose)
fastPathOrderedEmitMaxback to summary
protected final void fastPathOrderedEmitMax(U value, boolean delayError, Disposable dispose)
leaveback to summary
public final int leave(int m)

Adds m to the wip counter.

Parameters
m:int

the value to add

Returns:int

the current value after adding m

producedback to summary
public final long produced(long n)
requestedback to summary
public final long requested()
requestedback to summary
public final void requested(long n)
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable