public class SingleThreadedExecutor extends Object
shutDownAndAwaitTermination(java.time.Duration) when finished.
This implementation is thread-safe.
| Constructor and Description |
|---|
SingleThreadedExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable runnable)
Executes
runnable on the managed thread. |
void |
shutDownAndAwaitTermination(Duration timeout)
Shuts down the
executorService and waits for it to terminate. |
public void shutDownAndAwaitTermination(Duration timeout)
executorService and waits for it to terminate.timeout - timeout to wait. The method may call ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit)
times with the given timeout, so the overall wait time can go up to 2 times the timeoutCopyright © 2019. All rights reserved.