Class SerialExecutionQueue<T>
java.lang.Object
com.inductiveautomation.ignition.common.util.SerialExecutionQueue<T>
- Type Parameters:
T
- Submitted item type.
Queues up submitted items and executes them in serial on an ExecutorService.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
AnSerialExecutionQueue.ExecutionCallback
that executesRunnable
s. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSerialExecutionQueue
(SerialExecutionQueue.ExecutionCallback<T> callback, ExecutorService service) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SerialExecutionQueue.ExecutionCallback<T>
void
pause()
Pause evaluation of items in the queue.void
resume()
Resume evaluation of items in the queue.int
size()
void
Submit an item to be delivered to the callback when it's time to execute.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.
-
Field Details
-
RUNNABLE_EXECUTOR
-
-
Constructor Details
-
SerialExecutionQueue
public SerialExecutionQueue(SerialExecutionQueue.ExecutionCallback<T> callback, ExecutorService service)
-
-
Method Details
-
submit
Submit an item to be delivered to the callback when it's time to execute.- Parameters:
item
- Item to be delivered.
-
submitToHead
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
-