EventExecutorGroup implementation that handles their tasks with multiple threads at
the same time.
| Modifier and Type | Field and Description |
|---|---|
| private final EventExecutor[] | |
| private final AtomicLong | |
| private final boolean | |
| private final List | |
| private final AtomicInteger | |
| private final Promise |
| Access | Constructor and Description |
|---|---|
| public | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, ThreadFactory the ThreadFactory to use, or threadFactory)null if the default should be used.Create a new instance. |
| public | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, Executor the executor)Executor to use, or null if the default should be used.Create a new instance. |
| public | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, ThreadFactory the threadFactory, int ThreadFactory to use, or null if the default should be used.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance. |
| public | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, Executor the Executor to use, or executor, int null if the default should be used.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance. |
| protected | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, ThreadFactory the ThreadFactory to use, or threadFactory, int null if the default should be used.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler, Object... RejectedExecutionHandler to use.arguments which will passed to each args)newChild(Executor, int,
RejectedExecutionHandler, Object. callCreate a new instance. |
| protected | MultithreadEventExecutorGroup(int
the number of threads that will be used by this instance. nThreads, Executor the Executor to use, or executor, int null if the default should be used.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler, Object... RejectedExecutionHandler to use.arguments which will passed to each args)newChild(Executor, int,
RejectedExecutionHandler, Object. callCreate a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public final 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 final int | |
| protected final List | |
| private static boolean | |
| public final 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 final 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 final boolean | isTerminated()
Overrides default io. true if all EventExecutors managed by this EventExecutorGroup are
shut down, and all of their tasks have completed.
|
| public Iterator | iterator()
Implements io. T.
|
| protected EventExecutor | newChild(Executor executor, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler, Object... args)
Create a new EventExecutor which will later then accessible via the |
| public EventExecutor | next()
Implements io. EventExecutor to use.
|
| public final 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 final Future | terminationFuture()
Implements io. Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.
|
| children | back to summary |
|---|---|
| private final EventExecutor[] children | |
| idx | back to summary |
|---|---|
| private final AtomicLong idx | |
| powerOfTwo | back to summary |
|---|---|
| private final boolean powerOfTwo | |
| readonlyChildren | back to summary |
|---|---|
| private final List<EventExecutor> readonlyChildren | |
| terminatedChildren | back to summary |
|---|---|
| private final AtomicInteger terminatedChildren | |
| terminationFuture | back to summary |
|---|---|
| private final Promise<Void> terminationFuture | |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| public MultithreadEventExecutorGroup(int nThreads, ThreadFactory threadFactory) Create a new instance.
| |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| public MultithreadEventExecutorGroup(int nThreads, Executor executor) Create a new instance. | |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| public MultithreadEventExecutorGroup(int nThreads, ThreadFactory threadFactory, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance.
| |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| public MultithreadEventExecutorGroup(int nThreads, Executor executor, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance.
| |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| protected MultithreadEventExecutorGroup(int nThreads, ThreadFactory threadFactory, int maxPendingTasks, RejectedExecutionHandler rejectedHandler, Object... args) Create a new instance.
| |
| MultithreadEventExecutorGroup | back to summary |
|---|---|
| protected MultithreadEventExecutorGroup(int nThreads, Executor executor, int maxPendingTasks, RejectedExecutionHandler rejectedHandler, Object... args) Create a new instance.
| |
| awaitTermination | back to summary |
|---|---|
| public final boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException Overrides default io. Doc from io. Wait for this
| |
| executorCount | back to summary |
|---|---|
| public final int executorCount() Return the number of | |
| executors | back to summary |
|---|---|
| protected final List The | |
| isPowerOfTwo | back to summary |
|---|---|
| private static boolean isPowerOfTwo(int val) | |
| isShutdown | back to summary |
|---|---|
| public final 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 final 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 final boolean isTerminated() Overrides default io. Doc from io. Returns
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements io. Doc from java. Returns an iterator over elements of type
| |
| newChild | back to summary |
|---|---|
| protected EventExecutor newChild(Executor executor, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler, Object... args) Create a new EventExecutor which will later then accessible via the | |
| next | back to summary |
|---|---|
| public EventExecutor next() Implements io. Returns the next
| |
| shutdownGracefully | back to summary |
|---|---|
| public final 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 final Future Implements io. Doc from io. Returns the
| |