Class ExecutionQueue
java.lang.Object
org.eclipse.milo.opcua.stack.core.util.ExecutionQueue
Queues up submitted
Runnables and executes on an Executor, with optional concurrency.
When concurrency = 1 (the default) submitted tasks are guaranteed to run serially and
in the order submitted.
When concurrency > 1 there are no guarantees beyond the fact that tasks are still
pulled from a queue to be executed.
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionQueue(Executor executor) ExecutionQueue(Executor executor, int concurrencyLimit) -
Method Summary
-
Constructor Details
-
ExecutionQueue
-
ExecutionQueue
-
-
Method Details
-
submit
Submit aRunnableto be executed.- Parameters:
runnable- theRunnableto be executed.
-
submitToHead
Submit aRunnableto be executed at the head of the queue.- Parameters:
runnable- theRunnableto be executed.
-
pause
public void pause()Pause execution of queuedRunnables. -
resume
public void resume()Resume execution of queuedRunnables.
-