Top Fields Constructors Methods
reactor.core.publisher

pack-priv abstract Class DrainUtils

extends Object
Class Inheritance
Imports
java.util.Queue, java.util.concurrent.atomic.AtomicLongFieldUpdater, java.util.function.BooleanSupplier, org.reactivestreams.Subscriber, reactor.core.CoreSubscriber, reactor.util.annotation.Nullable

Field Summary

Modifier and TypeField and Description
pack-priv static final long
COMPLETED_MASK

Indicates the source completed and the value field is ready to be emitted.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static <
the output value type
T
,
the field type holding the requested amount
F
>
void
postComplete(CoreSubscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue holding available values
queue
,
AtomicLongFieldUpdater<F>
the field updater holding the requested amount
field
,
F
the parent instance of the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
)

Tries draining the queue if the source just completed.

public static <
the output value type
T
,
the field type holding the requested amount
F
>
void
postCompleteDelayError(CoreSubscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue of available values
queue
,
AtomicLongFieldUpdater<F>
the field updater for the requested amount
field
,
F
the parent instance of the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
,
Throwable
if not null, the error to signal after the queue has been drained
error
)

Tries draining the queue if the source just completed.

pack-priv static <T, F> boolean

Returns:

true if the queue was completely drained or the drain process was cancelled
postCompleteDrain
(long
the requested amount
n
,
Subscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue holding available values
queue
,
AtomicLongFieldUpdater<F>
the field updater holding the requested amount
field
,
F
the parent instance of the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
)

Drains the queue either in a pre- or post-complete state.

pack-priv static <T, F> boolean

Returns:

true if the queue was completely drained or the drain process was cancelled
postCompleteDrainDelayError
(long
the requested amount
n
,
Subscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue holding available values
queue
,
AtomicLongFieldUpdater<F>
the field updater holding the requested amount
field
,
F
the parent instance of the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
,
Throwable
the delayed error
error
)

Drains the queue either in a pre- or post-complete state, delaying an optional error to the end of the drain operation.

pack-priv static <
the output value type
T
,
the field type holding the requested amount
F
>
boolean

Returns:

true if the state indicates a completion state.
postCompleteRequest
(long
the requested amount
n
,
Subscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue holding the available values
queue
,
AtomicLongFieldUpdater<F>
the field updater for the requested amount
field
,
F
the parent instance for the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
)

Perform a potential post-completion request accounting.

public static <
the output value type
T
,
the field type holding the requested amount
F
>
boolean

Returns:

true if the state indicates a completion state.
postCompleteRequestDelayError
(long
the request amount
n
,
Subscriber<? super T>
the consumer of values
actual
,
Queue<T>
the queue of available values
queue
,
AtomicLongFieldUpdater<F>
the field updater for the requested amount
field
,
F
the parent instance of the requested field
instance
,
BooleanSupplier
callback to detect cancellation
isCancelled
,
Throwable
if not null, the error to signal after the queue has been drained
error
)

Perform a potential post-completion request accounting.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMPLETED_MASKback to summary
pack-priv static final long COMPLETED_MASK

Indicates the source completed and the value field is ready to be emitted.

The AtomicLong (this) holds the requested amount in bits 0..62 so there is room for one signal bit. This also means the standard request accounting helper method doesn't work.

REQUESTED_MASKback to summary
pack-priv static final long REQUESTED_MASK

Constructor Detail

DrainUtilsback to summary
pack-priv DrainUtils()

Method Detail

postCompleteback to summary
public static <T, F> void postComplete(CoreSubscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled)

Tries draining the queue if the source just completed.

Parameters
<T>
the output value type
<F>
the field type holding the requested amount
actual:CoreSubscriber<? super T>

the consumer of values

queue:Queue<T>

the queue holding available values

field:AtomicLongFieldUpdater<F>

the field updater holding the requested amount

instance:F

the parent instance of the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

postCompleteDelayErrorback to summary
public static <T, F> void postCompleteDelayError(CoreSubscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled, Throwable error)

Tries draining the queue if the source just completed.

Parameters
<T>
the output value type
<F>
the field type holding the requested amount
actual:CoreSubscriber<? super T>

the consumer of values

queue:Queue<T>

the queue of available values

field:AtomicLongFieldUpdater<F>

the field updater for the requested amount

instance:F

the parent instance of the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

error:Throwable

if not null, the error to signal after the queue has been drained

postCompleteDrainback to summary
pack-priv static <T, F> boolean postCompleteDrain(long n, Subscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled)

Drains the queue either in a pre- or post-complete state.

Parameters
n:long

the requested amount

actual:Subscriber<? super T>

the consumer of values

queue:Queue<T>

the queue holding available values

field:AtomicLongFieldUpdater<F>

the field updater holding the requested amount

instance:F

the parent instance of the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

Returns:boolean

true if the queue was completely drained or the drain process was cancelled

postCompleteDrainDelayErrorback to summary
pack-priv static <T, F> boolean postCompleteDrainDelayError(long n, Subscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled, Throwable error)

Drains the queue either in a pre- or post-complete state, delaying an optional error to the end of the drain operation.

Parameters
n:long

the requested amount

actual:Subscriber<? super T>

the consumer of values

queue:Queue<T>

the queue holding available values

field:AtomicLongFieldUpdater<F>

the field updater holding the requested amount

instance:F

the parent instance of the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

error:Throwable

the delayed error

Returns:boolean

true if the queue was completely drained or the drain process was cancelled

postCompleteRequestback to summary
pack-priv static <T, F> boolean postCompleteRequest(long n, Subscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled)

Perform a potential post-completion request accounting.

Parameters
<T>
the output value type
<F>
the field type holding the requested amount
n:long

the requested amount

actual:Subscriber<? super T>

the consumer of values

queue:Queue<T>

the queue holding the available values

field:AtomicLongFieldUpdater<F>

the field updater for the requested amount

instance:F

the parent instance for the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

Returns:boolean

true if the state indicates a completion state.

postCompleteRequestDelayErrorback to summary
public static <T, F> boolean postCompleteRequestDelayError(long n, Subscriber<? super T> actual, Queue<T> queue, AtomicLongFieldUpdater<F> field, F instance, BooleanSupplier isCancelled, Throwable error)

Perform a potential post-completion request accounting.

Parameters
<T>
the output value type
<F>
the field type holding the requested amount
n:long

the request amount

actual:Subscriber<? super T>

the consumer of values

queue:Queue<T>

the queue of available values

field:AtomicLongFieldUpdater<F>

the field updater for the requested amount

instance:F

the parent instance of the requested field

isCancelled:BooleanSupplier

callback to detect cancellation

error:Throwable

if not null, the error to signal after the queue has been drained

Returns:boolean

true if the state indicates a completion state.