public final class GlobalEventExecutor extends AbstractScheduledEventExecutor
| Modifier and Type | Field and Description |
|---|---|
static GlobalEventExecutor |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitInactivity(long timeout, java.util.concurrent.TimeUnit unit)
等待此执行程序的工作线程没有任务留在其任务队列中并终止本身。
|
boolean |
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable task) |
boolean |
inEventLoop(java.lang.Thread thread)
返回
true如果给定
Thread在事件循环中执行,
false其他。
|
boolean |
isShutdown() |
boolean |
isShuttingDown()
返回 true当且仅当所有EventExecutor由该被管小号EventExecutorGroup正在shut down gracefully或者被关闭。
|
boolean |
isTerminated() |
int |
pendingTasks()
返回待处理任务的数量。
|
void |
shutdown()
已过时。
|
Future<?> |
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
该执行者表示该调用者希望执行者被关闭。
|
Future<?> |
terminationFuture()
返回 Future ,当此EventExecutorGroup管理的所有EventExecutor已终止时将通知该Future 。
|
cancelScheduledTasks, hasScheduledTasks, nanoTime, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelayinEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, next, parent, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submitinvokeAll, invokeAll, invokeAny, invokeAnyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final GlobalEventExecutor INSTANCE
public int pendingTasks()
public boolean inEventLoop(java.lang.Thread thread)
EventExecutor
true如果给定
Thread在事件循环中执行,
false其他。
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroup
EventExecutorGroup.isShuttingDown()开始返回true ,并且执行程序准备关闭它。
与EventExecutorGroup.shutdown()不同,正常关机可确保在关闭之前没有任何任务被提交'安静期' (通常是几秒钟)。
如果任务在安静期提交,则保证被接受,安静期将重新开始。
quietPeriod - 文档中描述的安静期
timeout - 无论任务是否在静默期间提交,等待执行程序为
EventExecutorGroup.shutdown()的最长时间
unit - 单位
quietPeriod和
timeout
EventExecutorGroup.terminationFuture()
public Future<?> terminationFuture()
EventExecutorGroup
Future当所有被通知EventExecutor由该被管小号EventExecutorGroup已经终止。
@Deprecated public void shutdown()
shutdown ,界面
EventExecutorGroup
shutdown ,界面
java.util.concurrent.ExecutorService
shutdown在课堂上
AbstractEventExecutor
public boolean isShuttingDown()
EventExecutorGroup
true当且仅当EventExecutorGroup管理的所有EventExecutor正在为shut down gracefully或被关闭。
public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) public boolean awaitInactivity(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
true当且仅当工作者线程已被终止
java.lang.InterruptedException
public void execute(java.lang.Runnable task)
Copyright © 2008–2018 The Netty Project. All rights reserved.