public class ThreadlessExecutor extends AbstractExecutorService
Tasks submitted to this executor through execute(Runnable) will not get scheduled to a specific thread, though normal executors always do the schedule.
Those tasks are stored in a blocking queue and will only be executed when a thread calls #waitAndDrain(), the thread executing the task
is exactly the same as the one calling waitAndDrain.
| Constructor and Description |
|---|
ThreadlessExecutor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable runnable)
If the calling thread is still waiting for a callback task, add the task into the blocking queue to wait for schedule.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown()
The following methods are still not supported
|
List<Runnable> |
shutdownNow() |
void |
waitAndDrain(long deadline)
Waits until there is a task, executes the task and all queued tasks (if there're any).
|
public void waitAndDrain(long deadline)
throws InterruptedException
InterruptedExceptionpublic void execute(Runnable runnable)
runnable - public void shutdown()
public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout,
TimeUnit unit)
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.