public final class ImmediateEventExecutor extends AbstractEventExecutor
Runnable objects in the caller's thread. If the execute(Runnable) is reentrant it will be
queued until the original Runnable finishes execution.
All Throwable objects thrown from execute(Runnable) will be swallowed and logged. This is to ensure
that all queued Runnable objects have the chance to be run.
| 限定符和类型 | 字段和说明 |
|---|---|
static ImmediateEventExecutor |
INSTANCE |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
boolean |
inEventLoop(java.lang.Thread thread)
Return
true if the given Thread is executed in the event loop,
false otherwise. |
boolean |
isShutdown() |
boolean |
isShuttingDown()
Returns
true if and only if this executor was started to be
shut down gracefuclly or was shut down. |
boolean |
isTerminated() |
<V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise. |
<V> Promise<V> |
newPromise()
Return a new
Promise. |
EventExecutorGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor, |
void |
shutdown()
已过时。
|
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
java.util.concurrent.TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
Future<?> |
terminationFuture()
Returns the
Future which is notified when this executor has been terminated. |
iterator, newFailedFuture, newSucceededFuture, newTaskFor, newTaskFor, next, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitpublic static final ImmediateEventExecutor INSTANCE
public EventExecutorGroup parent()
EventExecutorEventExecutorGroup which is the parent of this EventExecutor,public boolean inEventLoop()
EventExecutorEventExecutor.inEventLoop(Thread) with Thread.currentThread() as argumentinEventLoop 在接口中 EventExecutorinEventLoop 在类中 AbstractEventExecutorpublic boolean inEventLoop(java.lang.Thread thread)
EventExecutortrue if the given Thread is executed in the event loop,
false otherwise.public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroupEventExecutorGroup.isShuttingDown() starts to return true, and the executor prepares to shut itself down.
Unlike EventExecutorGroup.shutdown(), graceful shutdown ensures that no tasks are submitted for 'the quiet period'
(usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period,
it is guaranteed to be accepted and the quiet period will start over.quietPeriod - the quiet period as described in the documentationtimeout - the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown()
regardless if a task was submitted during the quiet periodunit - the unit of quietPeriod and timeoutEventExecutorGroup.terminationFuture()public Future<?> terminationFuture()
EventExecutorGroupFuture which is notified when this executor has been terminated.@Deprecated public void shutdown()
shutdown 在接口中 EventExecutorGroupshutdown 在接口中 java.util.concurrent.ExecutorServiceshutdown 在类中 AbstractEventExecutorpublic boolean isShuttingDown()
EventExecutorGrouptrue if and only if this executor was started to be
shut down gracefuclly or was shut down.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()
EventExecutorPromise.newPromise 在接口中 EventExecutornewPromise 在类中 AbstractEventExecutorpublic <V> ProgressivePromise<V> newProgressivePromise()
EventExecutorProgressivePromise.newProgressivePromise 在接口中 EventExecutornewProgressivePromise 在类中 AbstractEventExecutor