Class DefaultEventExecutorGroup
java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.util.concurrent.DefaultEventExecutorGroup
- All Implemented Interfaces:
EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
Default implementation of
MultithreadEventExecutorGroup which will use DefaultEventExecutor instances
to handle the tasks.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventExecutorGroup(int nThreads) DefaultEventExecutorGroup(int nThreads, ThreadFactory threadFactory) Create a new instance.DefaultEventExecutorGroup(int nThreads, ThreadFactory threadFactory, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected EventExecutorCreate a new EventExecutor which will later then accessible via theMultithreadEventExecutorGroup.next()method.Methods inherited from class MultithreadEventExecutorGroup
awaitTermination, executorCount, isShutdown, isShuttingDown, isTerminated, iterator, newDefaultThreadFactory, next, shutdown, shutdownGracefully, terminationFutureModifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) final intReturn the number ofEventExecutorthis implementation uses.booleanbooleanReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.booleaniterator()protected ThreadFactorynext()Returns one of theEventExecutors managed by thisEventExecutorGroup.voidshutdown()Deprecated.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) Signals this executor that the caller wants the executor to be shut down.Future<?> Returns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.Methods inherited from class AbstractEventExecutorGroup
execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitModifier and TypeMethodDescriptionvoidinvokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <V> ScheduledFuture<V> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Future<?> Shortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.Deprecated.Future<?> <T> Future<T> <T> Future<T> Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultEventExecutorGroup
public DefaultEventExecutorGroup(int nThreads) - See Also:
-
DefaultEventExecutorGroup
Create a new instance.- Parameters:
nThreads- the number of threads that will be used by this instance.threadFactory- the ThreadFactory to use, ornullif the default should be used.
-
DefaultEventExecutorGroup
public DefaultEventExecutorGroup(int nThreads, ThreadFactory threadFactory, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance.- Parameters:
nThreads- the number of threads that will be used by this instance.threadFactory- the ThreadFactory to use, ornullif the default should be used.maxPendingTasks- the maximum number of pending tasks before new tasks will be rejected.rejectedHandler- theRejectedExecutionHandlerto use.
-
-
Method Details
-
newChild
Description copied from class:MultithreadEventExecutorGroupCreate a new EventExecutor which will later then accessible via theMultithreadEventExecutorGroup.next()method. This method will be called for each thread that will serve thisMultithreadEventExecutorGroup.- Specified by:
newChildin classMultithreadEventExecutorGroup- Throws:
Exception
-
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)orAbstractEventExecutorGroup.shutdownGracefully()instead.