Class MultithreadEventLoopGroup
java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.channel.MultithreadEventLoopGroup
- All Implemented Interfaces:
EventLoopGroup, EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
- Direct Known Subclasses:
DefaultEventLoopGroup, MultiThreadIoEventLoopGroup
public abstract class MultithreadEventLoopGroup
extends MultithreadEventExecutorGroup
implements EventLoopGroup
Abstract base class for
EventLoopGroup implementations that handles their tasks with multiple threads at
the same time.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultithreadEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, Object... args) protectedMultithreadEventLoopGroup(int nThreads, Executor executor, Object... args) protectedMultithreadEventLoopGroup(int nThreads, ThreadFactory threadFactory, Object... args) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EventLoopCreate a new EventExecutor which will later then accessible via theMultithreadEventExecutorGroup.next()method.protected ThreadFactorynext()Returns one of theEventExecutors managed by thisEventExecutorGroup.register(ChannelPromise promise) register(Channel channel, ChannelPromise promise) Deprecated.Methods inherited from class MultithreadEventExecutorGroup
activeExecutorCount, awaitTermination, executorCount, executorUtilizations, isShutdown, isShuttingDown, isTerminated, iterator, shutdown, shutdownGracefully, terminationFutureModifier and TypeMethodDescriptionintReturns the number of currently active threads if the group is using anEventExecutorChooserFactory.ObservableEventExecutorChooser.booleanawaitTermination(long timeout, TimeUnit unit) final intReturn the number ofEventExecutorthis implementation uses.Returns a list of real-time utilization metrics if the group was configured with a compatibleEventExecutorChooserFactory, otherwise an empty list.booleanbooleanReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.booleaniterator()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 EventExecutorGroup
tickerMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
MultithreadEventLoopGroup
-
MultithreadEventLoopGroup
- See Also:
-
MultithreadEventLoopGroup
protected MultithreadEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, Object... args) - See Also:
-
-
Method Details
-
newDefaultThreadFactory
- Overrides:
newDefaultThreadFactoryin classMultithreadEventExecutorGroup
-
next
Description copied from interface:EventExecutorGroupReturns one of theEventExecutors managed by thisEventExecutorGroup.- Specified by:
nextin interfaceEventExecutorGroup- Specified by:
nextin interfaceEventLoopGroup- Overrides:
nextin classMultithreadEventExecutorGroup
-
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
-
register
Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoop. The returnedChannelFuturewill get notified once the registration was complete.- Specified by:
registerin interfaceEventLoopGroup
-
register
Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoopusing aChannelFuture. The passedChannelFuturewill get notified once the registration was complete and also will get returned.- Specified by:
registerin interfaceEventLoopGroup
-
register
Deprecated.Description copied from interface:EventLoopGroupRegister aChannelwith thisEventLoop. The passedChannelFuturewill get notified once the registration was complete and also will get returned.- Specified by:
registerin interfaceEventLoopGroup
-
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit)orAbstractEventExecutorGroup.shutdownGracefully()instead.