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.
AbstractEventExecutor.LazyRunnable| Modifier and Type | Field and Description |
|---|---|
static ImmediateEventExecutor |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable command) |
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
boolean |
inEventLoop(Thread thread)
|
boolean |
isShutdown() |
boolean |
isShuttingDown()
Returns
true if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down. |
boolean |
isTerminated() |
<V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise. |
<V> Promise<V> |
newPromise()
Return a new
Promise. |
void |
shutdown()
Deprecated.
|
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
Future<?> |
terminationFuture()
Returns the
Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated. |
iterator, lazyExecute, newFailedFuture, newSucceededFuture, newTaskFor, newTaskFor, next, parent, runTask, safeExecute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitinvokeAll, invokeAll, invokeAny, invokeAnyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvokeAll, invokeAll, invokeAny, invokeAnyforEach, spliteratorpublic static final ImmediateEventExecutor INSTANCE
public boolean inEventLoop()
EventExecutorEventExecutor.inEventLoop(Thread) with Thread.currentThread() as argumentinEventLoop in interface EventExecutorinEventLoop in class AbstractEventExecutorpublic boolean inEventLoop(Thread thread)
EventExecutorpublic Future<?> shutdownGracefully(long quietPeriod, long timeout, 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 all EventExecutors managed by this
EventExecutorGroup have been terminated.@Deprecated public void shutdown()
shutdown in interface EventExecutorGroupshutdown in interface ExecutorServiceshutdown in class AbstractEventExecutorpublic boolean isShuttingDown()
EventExecutorGrouptrue if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout,
TimeUnit unit)
public void execute(Runnable command)
public <V> Promise<V> newPromise()
EventExecutorPromise.newPromise in interface EventExecutornewPromise in class AbstractEventExecutorpublic <V> ProgressivePromise<V> newProgressivePromise()
EventExecutorProgressivePromise.newProgressivePromise in interface EventExecutornewProgressivePromise in class AbstractEventExecutorCopyright © 2008–2025 The Netty Project. All rights reserved.