public enum QueueDrainHelper extends java.lang.Enum<QueueDrainHelper>
| Modifier and Type | Method and Description |
|---|---|
static <T,U> boolean |
checkTerminated(boolean d,
boolean empty,
NbpObservable.NbpSubscriber<?> s,
boolean delayError,
java.util.Queue<?> q,
Disposable disposable,
NbpQueueDrain<T,U> qd) |
static <T,U> boolean |
checkTerminated(boolean d,
boolean empty,
org.reactivestreams.Subscriber<?> s,
boolean delayError,
java.util.Queue<?> q,
QueueDrain<T,U> qd) |
static <T,U> void |
drainLoop(java.util.Queue<T> q,
NbpObservable.NbpSubscriber<? super U> a,
boolean delayError,
Disposable dispose,
NbpQueueDrain<T,U> qd) |
static <T,U> void |
drainLoop(java.util.Queue<T> q,
org.reactivestreams.Subscriber<? super U> a,
boolean delayError,
QueueDrain<T,U> qd) |
static <T,U> void |
drainMaxLoop(java.util.Queue<T> q,
org.reactivestreams.Subscriber<? super U> a,
boolean delayError,
Disposable dispose,
QueueDrain<T,U> qd)
Drain the queue but give up with an error if there aren't enough requests.
|
static <T> void |
queueDrain(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic.
|
static <T> void |
queueDrain(java.util.concurrent.atomic.AtomicInteger instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic.
|
static <T> void |
queueDrainIf(java.util.concurrent.atomic.AtomicInteger instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic with the ability to leave the state
in fastpath/drain mode or not continue after the call to queue.
|
static <T> void |
queueDrainIf(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic with the ability to leave the state
in fastpath/drain mode or not continue after the call to queue.
|
static <T> void |
queueDrainLoop(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic where the drain is looped until
the instance state reaches 0 again.
|
static <T> void |
queueDrainLoop(java.util.concurrent.atomic.AtomicInteger instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
A fast-path queue-drain serialization logic where the drain is looped until
the instance state reaches 0 again.
|
static <T> void |
queueDrainLoopIf(java.util.concurrent.atomic.AtomicInteger instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
BooleanSupplier drain)
A fast-path queue-drain serialization logic with looped drain call and the ability to leave the state
in fastpath/drain mode or not continue after the call to queue.
|
static <T> void |
queueDrainLoopIf(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
BooleanSupplier drain)
A fast-path queue-drain serialization logic with looped drain call and the ability to leave the state
in fastpath/drain mode or not continue after the call to queue.
|
static QueueDrainHelper |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static QueueDrainHelper[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static QueueDrainHelper[] values()
for (QueueDrainHelper c : QueueDrainHelper.values()) System.out.println(c);
public static QueueDrainHelper valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static <T> void queueDrain(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
The decrementing of the state is left to the drain callback.
T - the instance typeupdater - the field updaterinstance - the instance holding the fieldfastPath - called if the instance is uncontended.queue - called if the instance is contended to queue up workdrain - called if the instance transitions to the drain state successfullypublic static <T> void queueDrainIf(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
java.lang.Runnable drain)
The decrementing of the state is left to the drain callback.
T - the instance typeupdater - the field updaterinstance - the instance holding the fieldfastPath - queue - drain - public static <T> void queueDrainLoop(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
T - the instance typeupdater - the field updaterinstance - the instance holding the fieldfastPath - queue - drain - public static <T> void queueDrainLoopIf(java.util.concurrent.atomic.AtomicIntegerFieldUpdater<T> updater,
T instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
BooleanSupplier drain)
T - the instance typeupdater - the field updaterinstance - the instance holding the fieldfastPath - queue - drain - public static <T> void queueDrain(java.util.concurrent.atomic.AtomicInteger instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
The decrementing of the state is left to the drain callback.
T - the instance typeinstance - fastPath - called if the instance is uncontended.queue - called if the instance is contended to queue up workdrain - called if the instance transitions to the drain state successfullypublic static <T> void queueDrainIf(java.util.concurrent.atomic.AtomicInteger instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
java.lang.Runnable drain)
The decrementing of the state is left to the drain callback.
T - the instance typeinstance - fastPath - queue - drain - public static <T> void queueDrainLoop(java.util.concurrent.atomic.AtomicInteger instance,
java.lang.Runnable fastPath,
java.lang.Runnable queue,
java.lang.Runnable drain)
T - the instance typeinstance - fastPath - queue - drain - public static <T> void queueDrainLoopIf(java.util.concurrent.atomic.AtomicInteger instance,
BooleanSupplier fastPath,
BooleanSupplier queue,
BooleanSupplier drain)
T - the instance typeinstance - fastPath - queue - drain - public static <T,U> void drainLoop(java.util.Queue<T> q,
org.reactivestreams.Subscriber<? super U> a,
boolean delayError,
QueueDrain<T,U> qd)
public static <T,U> void drainMaxLoop(java.util.Queue<T> q,
org.reactivestreams.Subscriber<? super U> a,
boolean delayError,
Disposable dispose,
QueueDrain<T,U> qd)
T - the queue value typeU - the emission value typeq - the queuea - the subscriberdelayError - true if errors should be delayed after all normal itemsdispose - the disposable to call when termination happens and cleanup is necessaryqd - the QueueDrain instance that gives status information to the drain logicpublic static <T,U> boolean checkTerminated(boolean d,
boolean empty,
org.reactivestreams.Subscriber<?> s,
boolean delayError,
java.util.Queue<?> q,
QueueDrain<T,U> qd)
public static <T,U> void drainLoop(java.util.Queue<T> q,
NbpObservable.NbpSubscriber<? super U> a,
boolean delayError,
Disposable dispose,
NbpQueueDrain<T,U> qd)
public static <T,U> boolean checkTerminated(boolean d,
boolean empty,
NbpObservable.NbpSubscriber<?> s,
boolean delayError,
java.util.Queue<?> q,
Disposable disposable,
NbpQueueDrain<T,U> qd)