public class BoundedExecutor extends Object implements Executor
execute(Runnable) blocks if the number
of runnables already in the queue equals the maximum number of permits available.| Constructor and Description |
|---|
BoundedExecutor(ExecutorService executor,
int permits)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable command) |
void |
shutdownAndIgnoreQueue() |
void |
shutdownAndWait()
shutdown the ExecutorService and wait for it.
|
<T> Future<T> |
submit(Callable<T> task) |
public BoundedExecutor(ExecutorService executor, int permits)
executor - the executor service whose queue is to be bounded (required)permits - the number of runnables allowed in the queue at onceCopyright © 2002-2020 Atlassian. All Rights Reserved.