Package io.netty.util.concurrent
Interface EventExecutorGroup
- All Superinterfaces:
AutoCloseable
,Executor
,ExecutorService
,Iterable<EventExecutor>
,ScheduledExecutorService
- All Known Subinterfaces:
EventExecutor
,EventLoop
,EventLoopGroup
,OrderedEventExecutor
- All Known Implementing Classes:
AbstractEventExecutor
,AbstractEventExecutorGroup
,AbstractEventLoop
,AbstractEventLoopGroup
,AbstractScheduledEventExecutor
,DefaultEventExecutor
,DefaultEventExecutorGroup
,DefaultEventLoop
,DefaultEventLoopGroup
,EmbeddedEventLoop
,EpollEventLoop
,EpollEventLoopGroup
,GlobalEventExecutor
,ImmediateEventExecutor
,KQueueEventLoop
,KQueueEventLoopGroup
,LocalEventLoopGroup
,MultithreadEventExecutorGroup
,MultithreadEventLoopGroup
,NioEventLoop
,NioEventLoopGroup
,NonStickyEventExecutorGroup
,NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor
,OioEventLoopGroup
,SingleThreadEventExecutor
,SingleThreadEventLoop
,ThreadPerChannelEventLoop
,ThreadPerChannelEventLoopGroup
,UnorderedThreadPoolEventExecutor
The
EventExecutorGroup
is responsible for providing the EventExecutor
's to use
via its next()
method. Besides this, it is also responsible for handling their
life-cycle and allows shutting them down in a global fashion.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.iterator()
next()
Returns one of theEventExecutor
s managed by thisEventExecutorGroup
.<V> ScheduledFuture
<V> scheduleAtFixedRate
(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay
(Runnable command, long initialDelay, long delay, TimeUnit unit) void
shutdown()
Deprecated.Future
<?> Shortcut method forshutdownGracefully(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.Deprecated.Future
<?> <T> Future
<T> <T> Future
<T> Future
<?> Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, close, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
isShuttingDown
boolean isShuttingDown()Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down. -
shutdownGracefully
Future<?> shutdownGracefully()Shortcut method forshutdownGracefully(long, long, TimeUnit)
with sensible default values.- Returns:
- the
terminationFuture()
-
shutdownGracefully
Signals this executor that the caller wants the executor to be shut down. Once this method is called,isShuttingDown()
starts to returntrue
, and the executor prepares to shut itself down. Unlikeshutdown()
, 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.- Parameters:
quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is shutdown() regardless if a task was submitted during the quiet periodunit
- the unit ofquietPeriod
andtimeout
- Returns:
- the
terminationFuture()
-
terminationFuture
Future<?> terminationFuture()Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated. -
shutdown
Deprecated.- Specified by:
shutdown
in interfaceExecutorService
-
shutdownNow
Deprecated.- Specified by:
shutdownNow
in interfaceExecutorService
-
next
EventExecutor next()Returns one of theEventExecutor
s managed by thisEventExecutorGroup
. -
iterator
Iterator<EventExecutor> iterator()- Specified by:
iterator
in interfaceIterable<EventExecutor>
-
submit
- Specified by:
submit
in interfaceExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
scheduleAtFixedRate
ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRate
in interfaceScheduledExecutorService
-
scheduleWithFixedDelay
ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelay
in interfaceScheduledExecutorService
-
shutdownGracefully(long, long, TimeUnit)
orshutdownGracefully()
instead.