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.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final FastThreadLocal | DELAYED_RUNNABLES
A Runnable will be queued if we are executing a Runnable. |
| public static final ImmediateEventExecutor | |
| private static final InternalLogger | |
| private static final FastThreadLocal | RUNNING
Set to |
| private final Future |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | awaitTermination(long
The non-negative maximum amount of time to wait for the executor group to terminate. timeout, TimeUnit The non-null time unit of the timeout. unit)Overrides default io. EventExecutorGroup to terminate, up to the given timeout.
|
| public void | execute(Runnable
the runnable task task)Implements io. |
| public boolean | inEventLoop(Thread thread)
Implements io. true if the given Thread is executed in the event loop,
false otherwise.
|
| public boolean | isShutdown()
Implements io. true if all EventExecutors managed by this EventExecutorGroup have been
shut down gracefully and moved past the grace period so that they are no
longer accepting any new tasks.
|
| public boolean | isShuttingDown()
Implements io. true if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.
|
| public boolean | isTerminated()
Overrides default io. true if all EventExecutors managed by this EventExecutorGroup are
shut down, and all of their tasks have completed.
|
| public <V> Promise | newPromise()
Overrides default io. Promise.
|
| public Future | schedule(Runnable
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Implements io. EventExecutor
in this group, and return a future that produces a null result when the task completes.
|
| public <V> Future | schedule(Callable<V>
The task that should be executed in this task, long EventExecutorGroup after the given delay.A positive time delay, in the given time unit. delay, TimeUnit The non-null time unit for the delay. unit)Implements io. EventExecutor
in this group, and return a future that will return the result of the callable when the task completes.
|
| public Future | scheduleAtFixedRate(Runnable
The task that should be scheduled to execute at a fixed rate in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive period for the execution frequency to use after the first execution has started,
in terms of the given time unit. period, TimeUnit The non-null time unit for the delay and period. unit)Implements io. EventExecutor.
|
| public Future | scheduleWithFixedDelay(Runnable
The task that should be scheduled to execute with fixed delays in this task, long EventExecutorGroup.The positive initial delay for the first task execution, in terms of the given time unit. initialDelay, long The positive subsequent delay between task, to use after the first execution has completed,
in terms of the given time unit. delay, TimeUnit The non-null time unit for the delays. unit)Implements io. EventExecutor.
|
| public Future | shutdownGracefully(long
the quiet period as described in the documentation quietPeriod, long the maximum amount of time to wait until the executor is
shutting down regardless if a task was submitted during the quiet period. timeout, TimeUnit the unit of unit)quietPeriod and timeoutImplements io. |
| public Future | terminationFuture()
Implements io. Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.
|
| DELAYED_RUNNABLES | back to summary |
|---|---|
| private static final FastThreadLocal<Queue<Runnable>> DELAYED_RUNNABLES A Runnable will be queued if we are executing a Runnable. This is to prevent a | |
| INSTANCE | back to summary |
|---|---|
| public static final ImmediateEventExecutor INSTANCE | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger Hides io. | |
| RUNNING | back to summary |
|---|---|
| private static final FastThreadLocal<Boolean> RUNNING Set to | |
| terminationFuture | back to summary |
|---|---|
| private final Future<Void> terminationFuture | |
| ImmediateEventExecutor | back to summary |
|---|---|
| private ImmediateEventExecutor() | |
| awaitTermination | back to summary |
|---|---|
| public boolean awaitTermination(long timeout, TimeUnit unit) Overrides default io. Doc from io. Wait for this | |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements io. Doc from java. Executes the given command at some time in the future. The command
may execute in a new thread, in a pooled thread, or in the calling
thread, at the discretion of the | |
| inEventLoop | back to summary |
|---|---|
| public boolean inEventLoop(Thread thread) Implements io. Doc from io. Return
| |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Implements io. Doc from io. Returns An executor group that "is shut down" might still be executing tasks that it has queued up, but it will no longer be accepting any new tasks. Once all running and queued tasks have completed, the executor group will be terminated.
| |
| isShuttingDown | back to summary |
|---|---|
| public boolean isShuttingDown() Implements io. Doc from io. Returns An executor group that "is shutting down" can still accept new tasks for a little while (the grace period), but will eventually start rejecting new tasks. At that point, the executor group will be shut down.
| |
| isTerminated | back to summary |
|---|---|
| public boolean isTerminated() Overrides default io. Doc from io. Returns
| |
| newPromise | back to summary |
|---|---|
| public <V> Promise Overrides default io. Doc from io. Return a new
| |
| schedule | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| schedule | back to summary |
|---|---|
| public <V> Future Implements io. Doc from io. Schedule the given task for execution after the given delay, in the next available
| |
| scheduleAtFixedRate | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for periodic execution in the next available The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| scheduleWithFixedDelay | back to summary |
|---|---|
| public Future Implements io. Doc from io. Schedule the given task for periodic execution in the next available
This is in contrast to The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.
| |
| shutdownGracefully | back to summary |
|---|---|
| public Future Implements io. Doc from io. Signals this executor that the caller wants the executor to be shut down. Once this method is called,
| |
| terminationFuture | back to summary |
|---|---|
| public Future Implements io. Doc from io. Returns the
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void |
| ImmediatePromise | back to summary |
|---|---|
| pack-priv ImmediatePromise(EventExecutor executor) | |
| checkDeadLock | back to summary |
|---|---|
| protected void checkDeadLock() Overrides io.
| |