public final class ImmediateEventExecutor extends AbstractEventExecutor
Runnable对象。
如果execute(Runnable)可重入,它将排队,直到原始Runnable完成执行。
从execute(Runnable)抛出的所有Throwable对象将被吞下并记入日志。 这是为了确保所有排队的Runnable对象都有机会运行。
| Modifier and Type | Field and Description |
|---|---|
static ImmediateEventExecutor |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
boolean |
inEventLoop()
以
Thread.currentThread()作为参数调用
EventExecutor.inEventLoop(Thread)
|
boolean |
inEventLoop(java.lang.Thread thread)
返回
true如果给定
Thread在事件循环中执行,
false其他。
|
boolean |
isShutdown() |
boolean |
isShuttingDown()
返回 true当且仅当所有EventExecutor由该被管小号EventExecutorGroup正在shut down gracefully或者被关闭。
|
boolean |
isTerminated() |
<V> ProgressivePromise<V> |
newProgressivePromise()
创建一个新的 ProgressivePromise 。
|
<V> Promise<V> |
newPromise()
返回一个新的 Promise 。
|
void |
shutdown()
已过时。
|
Future<?> |
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
该执行者表示该调用者希望执行者被关闭。
|
Future<?> |
terminationFuture()
返回 Future ,当此EventExecutorGroup管理的所有EventExecutor都已终止时,会通知该Future 。
|
iterator, newFailedFuture, newSucceededFuture, newTaskFor, newTaskFor, next, parent, safeExecute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitinvokeAll, invokeAll, invokeAny, invokeAnyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final ImmediateEventExecutor INSTANCE
public boolean inEventLoop()
EventExecutor
Thread.currentThread()作为参数调用
EventExecutor.inEventLoop(Thread)
inEventLoop接口
EventExecutor
inEventLoop在课堂
AbstractEventExecutor
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 ,当此EventExecutorGroup管理的所有EventExecutor均已终止时,通知Future 。
@Deprecated public void shutdown()
shutdown ,界面
EventExecutorGroup
shutdown ,界面
java.util.concurrent.ExecutorService
shutdown在课堂
AbstractEventExecutor
public boolean isShuttingDown()
EventExecutorGroup
true当且仅当所有EventExecutor由该被管小号EventExecutorGroup正在shut down gracefully或者被关闭。
public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) public void execute(java.lang.Runnable command)
public <V> Promise<V> newPromise()
EventExecutor
Promise 。
newPromise ,界面
EventExecutor
newPromise
AbstractEventExecutor
public <V> ProgressivePromise<V> newProgressivePromise()
EventExecutor复制的描述
ProgressivePromise 。
newProgressivePromise ,界面
EventExecutor
newProgressivePromise在课堂
AbstractEventExecutor
Copyright © 2008–2018 The Netty Project. All rights reserved.