OrderedEventExecutor
's that execute all its submitted tasks in a single thread.
Modifier and Type | Class and Description |
---|---|
private static class | |
protected static interface | SingleThreadEventExecutor.
Deprecated
override
SingleThreadEventExecutor#wakesUpForTask to re-create this behaviour
|
Modifier and Type | Field and Description |
---|---|
private final boolean | |
pack-priv static final int | |
private final Executor | |
private volatile long | |
private long | |
private volatile long | |
private volatile boolean | |
private long | |
private static final InternalLogger | |
private final int | |
private static final Runnable | |
private static final AtomicReferenceFieldUpdater | |
private final RejectedExecutionHandler | |
private static final long | |
private final Set | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private volatile int | |
private static final AtomicIntegerFieldUpdater | |
private final Queue | |
private final Promise | |
private volatile Thread | |
private final CountDownLatch | |
private volatile ThreadProperties |
Access | Constructor and Description |
---|---|
protected | SingleThreadEventExecutor(EventExecutorGroup
the parent, ThreadFactory EventExecutorGroup which is the parent of this instance and belongs to itthe threadFactory, boolean ThreadFactory which will be used for the used Thread true if and only if invocation of addTask(Runnable) will wake up the
executor threadCreate a new instance |
protected | SingleThreadEventExecutor(EventExecutorGroup
the parent, ThreadFactory EventExecutorGroup which is the parent of this instance and belongs to itthe threadFactory, boolean ThreadFactory which will be used for the used Thread true if and only if invocation of addTask(Runnable) will wake up the
executor threadthe maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance |
protected | SingleThreadEventExecutor(EventExecutorGroup
the parent, Executor EventExecutorGroup which is the parent of this instance and belongs to itthe executor, boolean Executor which will be used for executingtrue if and only if invocation of addTask(Runnable) will wake up the
executor threadCreate a new instance |
protected | SingleThreadEventExecutor(EventExecutorGroup
the parent, Executor EventExecutorGroup which is the parent of this instance and belongs to itthe executor, boolean Executor which will be used for executingtrue if and only if invocation of addTask(Runnable) will wake up the
executor threadthe maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance |
protected | SingleThreadEventExecutor(EventExecutorGroup parent, Executor executor, boolean addTaskWakesUp, Queue<Runnable> taskQueue, RejectedExecutionHandler rejectedHandler)
|
Modifier and Type | Method and Description |
---|---|
public void | addShutdownHook(final Runnable task)
Add a |
protected void | addTask(Runnable task)
Add a task to the task queue, or throws a |
protected void | |
public boolean | awaitTermination(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. |
protected void | |
protected boolean | |
protected long | deadlineNanos()
Returns the absolute point in time (relative to |
protected long | delayNanos(long currentTimeNanos)
Returns the amount of time left until the scheduled task with the closest dead line is executed. |
private void | |
pack-priv final int | |
private boolean | |
public void | execute(Runnable
the runnable task task)Implements java. |
private void | |
private void | |
private boolean | |
private boolean | |
protected boolean | |
public boolean | inEventLoop(Thread thread)
Implements io. true if the given Thread is executed in the event loop,
false otherwise.
|
protected void | |
public <T> List | invokeAll(Collection<? extends Callable<T>>
the collection of tasks tasks)Overrides java. Implements java. |
public <T> List | invokeAll(Collection<? extends Callable<T>>
the collection of tasks tasks, long the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Overrides java. Implements java. |
public <T> T | invokeAny(Collection<? extends Callable<T>>
the collection of tasks tasks)Overrides java. Implements java. |
public <T> T | invokeAny(Collection<? extends Callable<T>>
the collection of tasks tasks, long the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Overrides java. Implements java. |
public boolean | isShutdown()
Implements java. true if this executor has been shut down.
|
public boolean | isShuttingDown()
Implements io. true if and only if all EventExecutor s managed by this EventExecutorGroup
are being shut down gracefully or was shut down.
|
public boolean | isTerminated()
Implements java. true if all tasks have completed following shut down.
|
public void | lazyExecute(Runnable task)
Overrides io. execute(Runnable) but does not guarantee the task will be run until either
a non-lazy task is executed or the executor is shut down.
|
private void | |
protected Queue | |
protected Queue | |
pack-priv final boolean | |
protected Runnable | |
public int | |
protected Runnable | |
protected static Runnable | |
protected static void | |
protected final void | |
public void | |
protected boolean | |
protected abstract void | |
protected boolean | Returns: true if and only if at least one task was runPoll all tasks from the task queue and run them via |
protected boolean | runAllTasks(long timeoutNanos)
Poll all tasks from the task queue and run them via |
protected final boolean | Returns: true if at least one task was executed.To poll and execute all tasks. taskQueue)Runs all tasks from the passed |
private boolean | runExistingTasksFrom(Queue<Runnable>
the task queue to drain. taskQueue)What ever tasks are present in |
protected final boolean | Returns: true if at least one task was run.The maximum amount of times this method attempts to drain from queues. This is to prevent
continuous task execution and scheduling from preventing the EventExecutor thread to
make progress and return to the selector mechanism to process inbound I/O events. maxDrainAttempts)Execute all expired scheduled tasks and all current tasks in the executor queue until both queues are empty,
or |
private boolean | |
public void | shutdown()
Implements abstract io. Implements io.
Deprecated
Initiates an orderly shutdown in which previously submitted
tasks are executed, but no new tasks will be accepted.
|
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 shutdown()
regardless if a task was submitted during the quiet period timeout, TimeUnit the unit of unit)quietPeriod and timeout Implements io. |
private void | |
protected Runnable | |
public Future | terminationFuture()
Implements io. Future which is notified when all EventExecutor s managed by this
EventExecutorGroup have been terminated.
|
public final ThreadProperties | threadProperties()
Returns the |
private void | |
protected void | updateLastExecutionTime()
Updates the internal timestamp that tells when a submitted task was executed most recently. |
protected boolean | wakesUpForTask(Runnable task)
Can be overridden to control which tasks require waking the |
protected void |