Package io.netty.util.concurrent
Interface EventExecutorGroup
-
- All Superinterfaces:
java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,java.lang.Iterable<EventExecutor>
,java.util.concurrent.ScheduledExecutorService
- All Known Subinterfaces:
EventExecutor
,EventLoop
,EventLoopGroup
,OrderedEventExecutor
- All Known Implementing Classes:
AbstractEventExecutor
,AbstractEventExecutorGroup
,AbstractEventLoop
,AbstractEventLoopGroup
,AbstractScheduledEventExecutor
,DefaultEventExecutor
,DefaultEventExecutorGroup
,DefaultEventLoop
,DefaultEventLoopGroup
,EmbeddedEventLoop
,GlobalEventExecutor
,ImmediateEventExecutor
,LocalEventLoopGroup
,MultithreadEventExecutorGroup
,MultithreadEventLoopGroup
,NioEventLoop
,NioEventLoopGroup
,NonStickyEventExecutorGroup
,NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor
,OioEventLoopGroup
,SingleThreadEventExecutor
,SingleThreadEventLoop
,ThreadPerChannelEventLoop
,ThreadPerChannelEventLoopGroup
,UnorderedThreadPoolEventExecutor
public interface EventExecutorGroup extends java.util.concurrent.ScheduledExecutorService, java.lang.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.java.util.Iterator<EventExecutor>
iterator()
EventExecutor
next()
Returns one of theEventExecutor
s managed by thisEventExecutorGroup
.ScheduledFuture<?>
schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
<V> ScheduledFuture<V>
schedule(java.util.concurrent.Callable<V> callable, 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()
Deprecated.Future<?>
shutdownGracefully()
Shortcut method forshutdownGracefully(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()
Deprecated.Future<?>
submit(java.lang.Runnable task)
<T> Future<T>
submit(java.lang.Runnable task, T result)
<T> Future<T>
submit(java.util.concurrent.Callable<T> task)
Future<?>
terminationFuture()
Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.
-
-
-
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, java.util.concurrent.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 interfacejava.util.concurrent.ExecutorService
-
shutdownNow
@Deprecated java.util.List<java.lang.Runnable> shutdownNow()
Deprecated.- Specified by:
shutdownNow
in interfacejava.util.concurrent.ExecutorService
-
next
EventExecutor next()
Returns one of theEventExecutor
s managed by thisEventExecutorGroup
.
-
iterator
java.util.Iterator<EventExecutor> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<EventExecutor>
-
submit
Future<?> submit(java.lang.Runnable task)
- Specified by:
submit
in interfacejava.util.concurrent.ExecutorService
-
submit
<T> Future<T> submit(java.lang.Runnable task, T result)
- Specified by:
submit
in interfacejava.util.concurrent.ExecutorService
-
submit
<T> Future<T> submit(java.util.concurrent.Callable<T> task)
- Specified by:
submit
in interfacejava.util.concurrent.ExecutorService
-
schedule
ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
schedule
in interfacejava.util.concurrent.ScheduledExecutorService
-
schedule
<V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
schedule
in interfacejava.util.concurrent.ScheduledExecutorService
-
scheduleAtFixedRate
ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
- Specified by:
scheduleAtFixedRate
in interfacejava.util.concurrent.ScheduledExecutorService
-
scheduleWithFixedDelay
ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
scheduleWithFixedDelay
in interfacejava.util.concurrent.ScheduledExecutorService
-
-