Package io.netty.util.concurrent
Interface EventExecutorGroup
-
- All Superinterfaces:
Executor,ExecutorService,Iterable<EventExecutor>,ScheduledExecutorService
- All Known Subinterfaces:
EventExecutor,OrderedEventExecutor
- All Known Implementing Classes:
AbstractEventExecutor,AbstractEventExecutorGroup,AbstractScheduledEventExecutor,DefaultEventExecutor,DefaultEventExecutorGroup,GlobalEventExecutor,ImmediateEventExecutor,MultithreadEventExecutorGroup,NonStickyEventExecutorGroup,SingleThreadEventExecutor,UnorderedThreadPoolEventExecutor
public interface EventExecutorGroup extends ScheduledExecutorService, Iterable<EventExecutor>
TheEventExecutorGroupis 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 booleanisShuttingDown()Returnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.Iterator<EventExecutor>iterator()EventExecutornext()Returns one of theEventExecutors 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)voidshutdown()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 theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave 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()
Returnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare 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 ofquietPeriodandtimeout- Returns:
- the
terminationFuture()
-
terminationFuture
Future<?> terminationFuture()
Returns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.
-
shutdown
@Deprecated void shutdown()
Deprecated.- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
@Deprecated List<Runnable> shutdownNow()
Deprecated.- Specified by:
shutdownNowin interfaceExecutorService
-
next
EventExecutor next()
Returns one of theEventExecutors managed by thisEventExecutorGroup.
-
iterator
Iterator<EventExecutor> iterator()
- Specified by:
iteratorin interfaceIterable<EventExecutor>
-
submit
Future<?> submit(Runnable task)
- Specified by:
submitin interfaceExecutorService
-
submit
<T> Future<T> submit(Runnable task, T result)
- Specified by:
submitin interfaceExecutorService
-
submit
<T> Future<T> submit(Callable<T> task)
- Specified by:
submitin interfaceExecutorService
-
schedule
ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
- Specified by:
schedulein interfaceScheduledExecutorService
-
schedule
<V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
- Specified by:
schedulein interfaceScheduledExecutorService
-
scheduleAtFixedRate
ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
- Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService
-
scheduleWithFixedDelay
ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
- Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService
-
-