@UnstableApi public final class NonStickyEventExecutorGroup extends java.lang.Object implements EventExecutorGroup
EventExecutorGroup
将保留Runnable
执行顺序,但不保证EventExecutor
(因此Thread
)将用于执行Runnable
s。
该EventExecutorGroup.next()
的包裹EventExecutorGroup
不得返回类型的执行人OrderedEventExecutor
。
Constructor and Description |
---|
NonStickyEventExecutorGroup(EventExecutorGroup group)
创建一个新的实例。
|
NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)
创建一个新的实例。
|
Modifier and Type | Method and Description |
---|---|
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()
返回 true 当且仅当所有EventExecutor 由该被管小号EventExecutorGroup 正在shut down gracefully或者被关闭。
|
boolean |
isTerminated() |
java.util.Iterator<EventExecutor> |
iterator() |
EventExecutor |
next()
|
<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()
|
Future<?> |
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
该执行者表示该调用者希望执行者被关闭。
|
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()
返回 Future 当所有被通知EventExecutor 由该被管小号EventExecutorGroup 已经终止。
|
public NonStickyEventExecutorGroup(EventExecutorGroup group)
EventExecutorGroup
不得包含任何OrderedEventExecutor
秒。
public NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)
EventExecutorGroup
不得包含任何OrderedEventExecutor
秒。
public boolean isShuttingDown()
EventExecutorGroup
true
当且仅当所有EventExecutor
由该被管小号EventExecutorGroup
正在shut down gracefully或者被关闭。
isShuttingDown
接口
EventExecutorGroup
public Future<?> shutdownGracefully()
EventExecutorGroup
shutdownGracefully
,界面
EventExecutorGroup
EventExecutorGroup.terminationFuture()
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroup
EventExecutorGroup.isShuttingDown()
开始返回true
,执行程序准备关闭。
与EventExecutorGroup.shutdown()
不同,正常关机可确保在关闭之前不会提交“安静期” (通常是几秒钟)的任务。
如果任务在安静期提交,则保证被接受,安静期将重新开始。
shutdownGracefully
,界面
EventExecutorGroup
quietPeriod
- 文档中描述的安静期
timeout
- 无论任务是否在静默期间提交,等待执行程序为
EventExecutorGroup.shutdown()的最长时间
unit
-
quietPeriod
和
timeout
的单位
EventExecutorGroup.terminationFuture()
public Future<?> terminationFuture()
EventExecutorGroup
Future
,当由EventExecutorGroup
管理的所有EventExecutor
已终止时,通知Future
。
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
复制的描述
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
in interface
java.util.concurrent.Executor
Copyright © 2008–2018 The Netty Project. All rights reserved.