@UnstableApi public final class NonStickyEventExecutorGroup extends java.lang.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 Runnable
s.
The EventExecutorGroup.next()
for the wrapped EventExecutorGroup
must NOT return
executors of type OrderedEventExecutor
.
构造器和说明 |
---|
NonStickyEventExecutorGroup(EventExecutorGroup group)
Creates a new instance.
|
NonStickyEventExecutorGroup(EventExecutorGroup group,
int maxTaskExecutePerRun)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isShuttingDown()
Returns
true if and only if all EventExecutor s managed by this EventExecutorGroup
are being shut down gracefully or was shut down. |
boolean |
isTerminated() |
java.util.Iterator<EventExecutor> |
iterator() |
EventExecutor |
next()
Returns one of the
EventExecutor s managed by this EventExecutorGroup . |
<V> ScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable,
long delay,
java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
Future<?> |
shutdownGracefully()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
java.util.concurrent.TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> Future<T> |
submit(java.util.concurrent.Callable<T> task) |
Future<?> |
submit(java.lang.Runnable task) |
<T> Future<T> |
submit(java.lang.Runnable task,
T result) |
Future<?> |
terminationFuture()
Returns the
Future which is notified when all EventExecutor s managed by this
EventExecutorGroup have been terminated. |
public NonStickyEventExecutorGroup(EventExecutorGroup group)
EventExecutorGroup
MUST NOT contain
any OrderedEventExecutor
s.public NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)
EventExecutorGroup
MUST NOT contain
any OrderedEventExecutor
s.public boolean isShuttingDown()
EventExecutorGroup
true
if and only if all EventExecutor
s managed by this EventExecutorGroup
are being shut down gracefully or was shut down.isShuttingDown
在接口中 EventExecutorGroup
public Future<?> shutdownGracefully()
EventExecutorGroup
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)
with sensible default values.shutdownGracefully
在接口中 EventExecutorGroup
EventExecutorGroup.terminationFuture()
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroup
EventExecutorGroup.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
在接口中 EventExecutorGroup
quietPeriod
- 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 timeout
EventExecutorGroup.terminationFuture()
public Future<?> terminationFuture()
EventExecutorGroup
Future
which is notified when all EventExecutor
s managed by this
EventExecutorGroup
have been terminated.terminationFuture
在接口中 EventExecutorGroup
public void shutdown()
shutdown
在接口中 EventExecutorGroup
shutdown
在接口中 java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
在接口中 EventExecutorGroup
shutdownNow
在接口中 java.util.concurrent.ExecutorService
public EventExecutor next()
EventExecutorGroup
EventExecutor
s managed by this EventExecutorGroup
.next
在接口中 EventExecutorGroup
public java.util.Iterator<EventExecutor> iterator()
iterator
在接口中 EventExecutorGroup
iterator
在接口中 java.lang.Iterable<EventExecutor>
public Future<?> submit(java.lang.Runnable task)
submit
在接口中 EventExecutorGroup
submit
在接口中 java.util.concurrent.ExecutorService
public <T> Future<T> submit(java.lang.Runnable task, T result)
submit
在接口中 EventExecutorGroup
submit
在接口中 java.util.concurrent.ExecutorService
public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit
在接口中 EventExecutorGroup
submit
在接口中 java.util.concurrent.ExecutorService
public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
在接口中 EventExecutorGroup
schedule
在接口中 java.util.concurrent.ScheduledExecutorService
public <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
在接口中 EventExecutorGroup
schedule
在接口中 java.util.concurrent.ScheduledExecutorService
public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
在接口中 EventExecutorGroup
scheduleAtFixedRate
在接口中 java.util.concurrent.ScheduledExecutorService
public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
在接口中 EventExecutorGroup
scheduleWithFixedDelay
在接口中 java.util.concurrent.ScheduledExecutorService
public boolean isShutdown()
isShutdown
在接口中 java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
在接口中 java.util.concurrent.ExecutorService
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination
在接口中 java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
invokeAll
在接口中 java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
invokeAll
在接口中 java.util.concurrent.ExecutorService
java.lang.InterruptedException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
在接口中 java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
invokeAny
在接口中 java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void execute(java.lang.Runnable command)
execute
在接口中 java.util.concurrent.Executor