History: 1.1.0 - experimental
| Modifier and Type | Class and Description |
|---|---|
| public static interface | BackpressureDrainManager.BackpressureQueueCallback
Interface representing the minimal callbacks required to operate the drain part of a backpressure system. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final BackpressureDrainManager. | actual
The callbacks to manage the drain. |
| pack-priv boolean | emitting
Indicates if one is in emitting phase, guarded by this. |
| pack-priv Throwable | exception
Indicates an error state, barrier is provided via terminated. |
| private static final long | |
| pack-priv volatile boolean | terminated
Indicates a terminal state. |
| Access | Constructor and Description |
|---|---|
| public | BackpressureDrainManager(BackpressureDrainManager.
he queue callback to check for new element availability actualConstructs a backpressure drain manager with 0 requestedCount, no terminal event and not emitting. |
| Modifier and Type | Method and Description |
|---|---|
| public void | drain()
Try to drain the "queued" elements and terminal events by considering the available and requested event counts. |
| public boolean | Returns: true if a terminal state has been reachedChecks if a terminal state has been reached. |
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| public void | |
| public void | |
| public void | |
| public void | terminateAndDrain(Throwable
the exception to deliver error)Move into a terminal state with an exception and drain. |
| actual | back to summary |
|---|---|
| pack-priv final BackpressureDrainManager. The callbacks to manage the drain. | |
| emitting | back to summary |
|---|---|
| pack-priv boolean emitting Indicates if one is in emitting phase, guarded by this. | |
| exception | back to summary |
|---|---|
| pack-priv Throwable exception Indicates an error state, barrier is provided via terminated. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| terminated | back to summary |
|---|---|
| pack-priv volatile boolean terminated Indicates a terminal state. | |
| BackpressureDrainManager | back to summary |
|---|---|
| public BackpressureDrainManager(BackpressureDrainManager. Constructs a backpressure drain manager with 0 requestedCount, no terminal event and not emitting.
| |
| drain | back to summary |
|---|---|
| public void drain() Try to drain the "queued" elements and terminal events by considering the available and requested event counts. | |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Checks if a terminal state has been reached.
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |
| terminate | back to summary |
|---|---|
| public void terminate() Move into a terminal state. Call drain() anytime after. | |
| terminate | back to summary |
|---|---|
| public void terminate(Throwable error) Move into a terminal state with an exception. Call drain() anytime after. Serialized access is expected with respect to element emission.
| |
| terminateAndDrain | back to summary |
|---|---|
| public void terminateAndDrain() Move into a terminal state and drain. | |
| terminateAndDrain | back to summary |
|---|---|
| public void terminateAndDrain(Throwable error) Move into a terminal state with an exception and drain. Serialized access is expected with respect to element emission.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public Object | Returns: the next element or null if no next element availableOverride this method to peek for the next element, null meaning no next element available now. |
| public Object | Returns: the next element or null if no next element availableOverride this method to poll (consume) the next element, null meaning no next element available now. |
| accept | back to summary |
|---|---|
| public boolean accept(Object value) Override this method to deliver an element to downstream. The logic ensures that this happens only in the right conditions.
| |
| complete | back to summary |
|---|---|
| public void complete(Throwable exception) Override this method to deliver a normal or exceptional terminal event.
| |
| peek | back to summary |
|---|---|
| public Object peek() Override this method to peek for the next element, null meaning no next element available now. It will be called plain and while holding this object's monitor.
| |
| poll | back to summary |
|---|---|
| public Object poll() Override this method to poll (consume) the next element, null meaning no next element available now.
| |