@UnstableApi public final class NonStickyEventExecutorGroup extends Object implements EventExecutorGroup
EventExecutorGroup which will preserve Runnable execution order but makes no guarantees about what
EventExecutor (and therefore Thread) will be used to execute the Runnables.
The EventExecutorGroup.next() for the wrapped EventExecutorGroup must NOT return
executors of type OrderedEventExecutor.
| Constructor and Description |
|---|
NonStickyEventExecutorGroup(EventExecutorGroup group)
Creates a new instance.
|
NonStickyEventExecutorGroup(EventExecutorGroup group,
int maxTaskExecutePerRun)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable command) |
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
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() |
Iterator<EventExecutor> |
iterator() |
EventExecutor |
next()
Returns one of the
EventExecutors managed by this EventExecutorGroup. |
<V> ScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit) |
void |
shutdown() |
Future<?> |
shutdownGracefully()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
List<Runnable> |
shutdownNow() |
<T> Future<T> |
submit(Callable<T> task) |
Future<?> |
submit(Runnable task) |
<T> Future<T> |
submit(Runnable task,
T result) |
Future<?> |
terminationFuture()
Returns the
Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic NonStickyEventExecutorGroup(EventExecutorGroup group)
EventExecutorGroup MUST NOT contain
any OrderedEventExecutors.public NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)
EventExecutorGroup MUST NOT contain
any OrderedEventExecutors.public boolean isShuttingDown()
EventExecutorGrouptrue if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.isShuttingDown in interface EventExecutorGrouppublic Future<?> shutdownGracefully()
EventExecutorGroupEventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.shutdownGracefully in interface EventExecutorGroupEventExecutorGroup.terminationFuture()public 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.shutdownGracefully in interface EventExecutorGroupquietPeriod - 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.terminationFuture in interface EventExecutorGrouppublic void shutdown()
shutdown in interface EventExecutorGroupshutdown in interface ExecutorServicepublic List<Runnable> shutdownNow()
shutdownNow in interface EventExecutorGroupshutdownNow in interface ExecutorServicepublic EventExecutor next()
EventExecutorGroupEventExecutors managed by this EventExecutorGroup.next in interface EventExecutorGrouppublic Iterator<EventExecutor> iterator()
iterator in interface EventExecutorGroupiterator in interface Iterable<EventExecutor>public Future<?> submit(Runnable task)
submit in interface EventExecutorGroupsubmit in interface ExecutorServicepublic <T> Future<T> submit(Runnable task, T result)
submit in interface EventExecutorGroupsubmit in interface ExecutorServicepublic <T> Future<T> submit(Callable<T> task)
submit in interface EventExecutorGroupsubmit in interface ExecutorServicepublic ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
schedule in interface EventExecutorGroupschedule in interface ScheduledExecutorServicepublic <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
schedule in interface EventExecutorGroupschedule in interface ScheduledExecutorServicepublic ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
scheduleAtFixedRate in interface EventExecutorGroupscheduleAtFixedRate in interface ScheduledExecutorServicepublic ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
scheduleWithFixedDelay in interface EventExecutorGroupscheduleWithFixedDelay in interface ScheduledExecutorServicepublic boolean isShutdown()
isShutdown in interface ExecutorServicepublic boolean isTerminated()
isTerminated in interface ExecutorServicepublic boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceInterruptedExceptionpublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedExceptionpublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedExceptionpublic <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
invokeAny in interface ExecutorServiceInterruptedExceptionExecutionExceptionpublic <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
invokeAny in interface ExecutorServiceInterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2008–2025 The Netty Project. All rights reserved.