public final class DefaultSingleThreadExecutor extends Object implements SingleThreadExecutor
| 构造器和说明 |
|---|
DefaultSingleThreadExecutor(ExecutorService singleThreadExecutorService)
Anti-gentleman is not against villains, we believe that you are
providing a single-thread executor.
|
DefaultSingleThreadExecutor(String poolName,
int maxPendingTasks) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 SingleThreadExecutorpublic boolean shutdownGracefully(long timeout,
TimeUnit unit)
SingleThreadExecutorshutdownGracefully 在接口中 SingleThreadExecutortimeout - the maximum amount of time to wait until the executor
is shutdownunit - the unit of timeoutCopyright © 2021. All rights reserved.