public final class DefaultSingleThreadExecutor extends Object implements SingleThreadExecutor
| Constructor and Description |
|---|
DefaultSingleThreadExecutor(ExecutorService singleThreadExecutorService)
Anti-gentleman is not against villains, we believe that you are
providing a single-thread executor.
|
DefaultSingleThreadExecutor(String poolName,
int maxPendingTasks) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable task) |
boolean |
shutdownGracefully()
Shortcut method for
SingleThreadExecutor.shutdownGracefully(long, TimeUnit) with
sensible default values. |
boolean |
shutdownGracefully(long timeout,
TimeUnit unit)
Signals this executor that the caller wants it to be shutdown.
|
public DefaultSingleThreadExecutor(ExecutorService singleThreadExecutorService)
singleThreadExecutorService - a ExecutorService instancepublic DefaultSingleThreadExecutor(String poolName, int maxPendingTasks)
public boolean shutdownGracefully()
SingleThreadExecutorSingleThreadExecutor.shutdownGracefully(long, TimeUnit) with
sensible default values.shutdownGracefully in interface SingleThreadExecutorpublic boolean shutdownGracefully(long timeout,
TimeUnit unit)
SingleThreadExecutorshutdownGracefully in interface SingleThreadExecutortimeout - the maximum amount of time to wait until the executor
is shutdownunit - the unit of timeoutCopyright © 2024. All rights reserved.