T
- Actor type.public class ManualWorkQueue<T extends AbstractManualActionContext<?>>
extends java.lang.Object
AbstractManualActionContext
using the estimated perform time (
AbstractManualActionContext.getEstimated()
). This is a convenience class for creating an
ActionEngine
.ManualActionEngine
,
ForkJoinActionEngine
Constructor and Description |
---|
ManualWorkQueue()
Creates a new instance of ManualWorkQueue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addWaitingWork(T context)
Adds work to the queue.
|
void |
awaitNextReadyWork()
Awaits until the next work is ready (or the work queue is empty).
|
java.util.List<? extends T> |
getWaitingWork()
Gets all waiting work in the queue.
|
boolean |
isWaitingWork(T context)
Whether the work is contained in the queue.
|
boolean |
isWorkReady()
Whether there is work ready.
|
boolean |
isWorkWaiting()
Whether the queue has waiting work.
|
T |
pollReadyWork()
Polls for ready work (removes if work is available).
|
void |
removeAllWaitingWork()
Clears waiting work.
|
boolean |
removeWaitingWork(T context)
Removes work from the queue.
|
int |
waitingWorkSize()
Gets the waiting work count.
|
public ManualWorkQueue()
public boolean addWaitingWork(T context)
context
- Work to add.public void awaitNextReadyWork() throws java.lang.InterruptedException
java.lang.InterruptedException
- Whether the wait is interrupted.public java.util.List<? extends T> getWaitingWork()
public boolean isWaitingWork(T context)
context
- Work to check.public boolean isWorkReady()
public boolean isWorkWaiting()
public T pollReadyWork()
public void removeAllWaitingWork()
public boolean removeWaitingWork(T context)
context
- Work to remove.public int waitingWorkSize()