EventExecutor implementation which makes no guarantees about the ordering of task execution that
are submitted because there may be multiple threads executing these tasks.
This implementation is most useful for protocols that do not need strict ordering.
Because it provides no ordering care should be taken when using it!
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | UnorderedThreadPoolEventExecutor.RunnableScheduledFutureTask<V>
Note this class has a natural ordering that is inconsistent with equals. |
| Modifier and Type | Field and Description |
|---|---|
| private final UnorderedThreadPoolEventExecutor. | |
| private static final InternalLogger | |
| private final Promise |
| Access | Constructor and Description |
|---|---|
| public | |
| public | UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory)
See |
| public | |
| public | UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
|
| 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. |
| pack-priv BlockingQueue | Returns: The task queue of this executor.Return the task queue of the underlying |
| 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 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 | submit(Runnable
The task that should be executed in this task)EventExecutorGroup.Implements io. EventExecutor in this group,
and return a future that produces a null result when the task completes.
|
| public <T> Future | submit(Runnable
The task that should be executed in this task, T EventExecutorGroup.The value that the returned future will complete with, if the task completes successfully. result)Implements io. EventExecutor in this group,
and return a future that produces the given result when the task completes.
|
| public <T> Future | submit(Callable<T>
The task that should be executed in this task)EventExecutorGroup.Implements io. EventExecutor in this group,
and return a future that will return the result of the callable when the task completes.
|
| public Future | terminationFuture()
Implements io. Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.
|
| executor | back to summary |
|---|---|
| private final UnorderedThreadPoolEventExecutor. | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| terminationFuture | back to summary |
|---|---|
| private final Promise<Void> terminationFuture | |
| UnorderedThreadPoolEventExecutor | back to summary |
|---|---|
| public UnorderedThreadPoolEventExecutor(int corePoolSize) Calls | |
| UnorderedThreadPoolEventExecutor | back to summary |
|---|---|
| public UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory) See | |
| UnorderedThreadPoolEventExecutor | back to summary |
|---|---|
| public UnorderedThreadPoolEventExecutor(int corePoolSize, RejectedExecutionHandler handler) Calls | |
| UnorderedThreadPoolEventExecutor | back to summary |
|---|---|
| public UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) | |
| awaitTermination | back to summary |
|---|---|
| public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException 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 | |
| getQueue | back to summary |
|---|---|
| pack-priv BlockingQueue Return the task queue of the underlying Visible for testing.
| |
| 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
| |
| 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,
| |
| submit | back to summary |
|---|---|
| public Future Implements io. Doc from io. Submit the given task for execution in the next available
| |
| submit | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Submit the given task for execution in the next available
| |
| submit | back to summary |
|---|---|
| public <T> Future Implements io. Doc from io. Submit the given task for execution in the next available
| |
| terminationFuture | back to summary |
|---|---|
| public Future Implements io. Doc from io. Returns the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final EventExecutor |
| Access | Constructor and Description |
|---|---|
| pack-priv | InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory)
|
| pack-priv | InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
|
| Modifier and Type | Method and Description |
|---|---|
| protected <V> RunnableScheduledFuture | decorateTask(Runnable
the submitted Runnable runnable, RunnableScheduledFuture<V> the task created to execute the runnable task)Overrides java. |
| protected <V> RunnableScheduledFuture | decorateTask(Callable<V>
the submitted Callable callable, RunnableScheduledFuture<V> the task created to execute the callable task)Overrides java. |
| eventExecutor | back to summary |
|---|---|
| private final EventExecutor eventExecutor | |
| InnerScheduledThreadPoolExecutor | back to summary |
|---|---|
| pack-priv InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory) | |
| InnerScheduledThreadPoolExecutor | back to summary |
|---|---|
| pack-priv InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) | |
| decorateTask | back to summary |
|---|---|
| protected <V> RunnableScheduledFuture Overrides java. Doc from java. Modifies or replaces the task used to execute a runnable. This method can be used to override the concrete class used for managing internal tasks. The default implementation simply returns the given task.
| |
| decorateTask | back to summary |
|---|---|
| protected <V> RunnableScheduledFuture Overrides java. Doc from java. Modifies or replaces the task used to execute a callable. This method can be used to override the concrete class used for managing internal tasks. The default implementation simply returns the given task.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| task | back to summary |
|---|---|
| private final Runnable task | |
| NonNotifyRunnable | back to summary |
|---|---|
| pack-priv NonNotifyRunnable(Runnable task) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
Note
this class has a natural ordering that is inconsistent with equals.
| Modifier and Type | Field and Description |
|---|---|
| private final RunnableScheduledFuture |
| Access | Constructor and Description |
|---|---|
| pack-priv | RunnableScheduledFutureTask(EventExecutor executor, Runnable runnable, RunnableScheduledFuture<V> future)
|
| pack-priv | RunnableScheduledFutureTask(EventExecutor executor, Callable<V> callable, RunnableScheduledFuture<V> future)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Delayed
the object to be compared. o)Implements java. |
| public long | getDelay(TimeUnit
the time unit unit)Implements java. |
| public boolean | isPeriodic()
Implements java. true if this task is periodic.
|
| public void | run()
Overrides io. Implements java. |
| future | back to summary |
|---|---|
| private final RunnableScheduledFuture<V> future | |
| RunnableScheduledFutureTask | back to summary |
|---|---|
| pack-priv RunnableScheduledFutureTask(EventExecutor executor, Runnable runnable, RunnableScheduledFuture<V> future) | |
| RunnableScheduledFutureTask | back to summary |
|---|---|
| pack-priv RunnableScheduledFutureTask(EventExecutor executor, Callable<V> callable, RunnableScheduledFuture<V> future) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Delayed o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| getDelay | back to summary |
|---|---|
| public long getDelay(TimeUnit unit) Implements java. Doc from java. Returns the remaining delay associated with this object, in the given time unit. | |
| isPeriodic | back to summary |
|---|---|
| public boolean isPeriodic() Implements java. Doc from java. Returns
| |
| run | back to summary |
|---|---|
| public void run() Overrides io. Implements java. Doc from java. Sets this Future to the result of its computation unless it has been cancelled.
| |