public class ExecutionQueue extends Object
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 and Description |
|---|
ExecutionQueue(Executor executor) |
ExecutionQueue(Executor executor,
int concurrencyLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
pause()
Pause execution of queued
Runnables. |
void |
resume()
Resume execution of queued
Runnables. |
void |
submit(Runnable runnable)
Submit a
Runnable to be executed. |
void |
submitToHead(Runnable runnable)
Submit a
Runnable to be executed at the head of the queue. |
public ExecutionQueue(Executor executor)
public ExecutionQueue(Executor executor, int concurrencyLimit)
public void submit(Runnable runnable)
Runnable to be executed.runnable - the Runnable to be executed.public void submitToHead(Runnable runnable)
Runnable to be executed at the head of the queue.runnable - the Runnable to be executed.public void pause()
Runnables.public void resume()
Runnables.Copyright © 2025. All rights reserved.