Package io.netty.util.concurrent
Interface EventExecutorGroup
-
- All Superinterfaces:
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
,GlobalEventExecutor
,ImmediateEventExecutor
,LocalEventLoopGroup
,MultithreadEventExecutorGroup
,MultithreadEventLoopGroup
,NioEventLoop
,NioEventLoopGroup
,NonStickyEventExecutorGroup
,OioEventLoopGroup
,SingleThreadEventExecutor
,SingleThreadEventLoop
,ThreadPerChannelEventLoop
,ThreadPerChannelEventLoopGroup
,UnorderedThreadPoolEventExecutor
public interface EventExecutorGroup extends ScheduledExecutorService, Iterable<EventExecutor>
TheEventExecutorGroup
is responsible for providing theEventExecutor
's to use via itsnext()
method. Besides this, it is also responsible for handling their life-cycle and allows shutting them down in a global fashion.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
isShuttingDown()
Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.Iterator<EventExecutor>
iterator()
EventExecutor
next()
Returns one of theEventExecutor
s managed by thisEventExecutorGroup
.ScheduledFuture<?>
schedule(Runnable command, long delay, TimeUnit unit)
<V> ScheduledFuture<V>
schedule(Callable<V> callable, 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()
Deprecated.Future<?>
shutdownGracefully()
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.List<Runnable>
shutdownNow()
Deprecated.Future<?>
submit(Runnable task)
<T> Future<T>
submit(Runnable task, T result)
<T> Future<T>
submit(Callable<T> task)
Future<?>
terminationFuture()
Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
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
Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
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 void shutdown()
Deprecated.- Specified by:
shutdown
in interfaceExecutorService
-
shutdownNow
@Deprecated List<Runnable> 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
Future<?> submit(Runnable task)
- Specified by:
submit
in interfaceExecutorService
-
submit
<T> Future<T> submit(Runnable task, T result)
- Specified by:
submit
in interfaceExecutorService
-
submit
<T> Future<T> submit(Callable<T> task)
- Specified by:
submit
in interfaceExecutorService
-
schedule
ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
- Specified by:
schedule
in interfaceScheduledExecutorService
-
schedule
<V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
- 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
-
-