Class SerialExecutionQueue<T>
- java.lang.Object
-
- com.inductiveautomation.ignition.common.util.SerialExecutionQueue<T>
-
- Type Parameters:
T- Submitted item type.
public class SerialExecutionQueue<T> extends java.lang.ObjectQueues up submitted items and executes them in serial on an ExecutorService.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSerialExecutionQueue.ExecutionCallback<T>static classSerialExecutionQueue.RunnableExecutorAnSerialExecutionQueue.ExecutionCallbackthat executesRunnables.
-
Field Summary
Fields Modifier and Type Field Description static SerialExecutionQueue.RunnableExecutorRUNNABLE_EXECUTOR
-
Constructor Summary
Constructors Constructor Description SerialExecutionQueue(SerialExecutionQueue.ExecutionCallback<T> callback, java.util.concurrent.ExecutorService service)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> SerialExecutionQueue.ExecutionCallback<T>noOpCallback()voidpause()Pause evaluation of items in the queue.voidresume()Resume evaluation of items in the queue.intsize()voidsubmit(T item)Submit an item to be delivered to the callback when it's time to execute.voidsubmitToHead(T item)Submit an item at the head of the queue to be delivered to the callback when it's time to execute.
-
-
-
Field Detail
-
RUNNABLE_EXECUTOR
public static final SerialExecutionQueue.RunnableExecutor RUNNABLE_EXECUTOR
-
-
Constructor Detail
-
SerialExecutionQueue
public SerialExecutionQueue(SerialExecutionQueue.ExecutionCallback<T> callback, java.util.concurrent.ExecutorService service)
-
-
Method Detail
-
submit
public void submit(T item)
Submit an item to be delivered to the callback when it's time to execute.- Parameters:
item- Item to be delivered.
-
submitToHead
public void submitToHead(T item)
Submit an item at the head of the queue to be delivered to the callback when it's time to execute.- Parameters:
item- Item to be delivered.
-
pause
public void pause()
Pause evaluation of items in the queue.
-
resume
public void resume()
Resume evaluation of items in the queue.
-
size
public int size()
-
noOpCallback
public static <T> SerialExecutionQueue.ExecutionCallback<T> noOpCallback()
-
-