Class NioEventLoopGroup
java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.channel.MultithreadEventLoopGroup
io.netty.channel.nio.NioEventLoopGroup
- All Implemented Interfaces:
EventLoopGroup, EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance using the default number of threads, the defaultThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider().NioEventLoopGroup(int nThreads) Create a new instance using the specified number of threads,ThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider().NioEventLoopGroup(int nThreads, Executor executor) NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler) NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory) NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider) NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) NioEventLoopGroup(int nThreads, ThreadFactory threadFactory) Create a new instance using the specified number of threads, the givenThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider().NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider) Create a new instance using the specified number of threads, the givenThreadFactoryand the givenSelectorProvider.NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) NioEventLoopGroup(ThreadFactory threadFactory) Create a new instance using the default number of threads, the givenThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider(). -
Method Summary
Modifier and TypeMethodDescriptionprotected EventLoopCreate a new EventExecutor which will later then accessible via theMultithreadEventExecutorGroup.next()method.voidvoidsetIoRatio(int ioRatio) Sets the percentage of the desired amount of time spent for I/O in the child event loops.Methods inherited from class MultithreadEventLoopGroup
newDefaultThreadFactory, next, register, register, registerMethods inherited from class MultithreadEventExecutorGroup
awaitTermination, executorCount, isShutdown, isShuttingDown, isTerminated, iterator, shutdown, shutdownGracefully, terminationFutureMethods inherited from class AbstractEventExecutorGroup
execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventExecutorGroup
isShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFutureMethods inherited from interface ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
NioEventLoopGroup
public NioEventLoopGroup()Create a new instance using the default number of threads, the defaultThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider(). -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads) Create a new instance using the specified number of threads,ThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider(). -
NioEventLoopGroup
Create a new instance using the default number of threads, the givenThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider(). -
NioEventLoopGroup
Create a new instance using the specified number of threads, the givenThreadFactoryand theSelectorProviderwhich is returned bySelectorProvider.provider(). -
NioEventLoopGroup
-
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider) Create a new instance using the specified number of threads, the givenThreadFactoryand the givenSelectorProvider. -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) -
NioEventLoopGroup
-
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory) -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler) -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory) -
NioEventLoopGroup
public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) - Parameters:
nThreads- the number of threads that will be used by this instance.executor- the Executor to use, ornullif default one should be used.chooserFactory- theEventExecutorChooserFactoryto use.selectorProvider- theSelectorProviderto use.selectStrategyFactory- theSelectStrategyFactoryto use.rejectedExecutionHandler- theRejectedExecutionHandlerto use.taskQueueFactory- theEventLoopTaskQueueFactoryto use forSingleThreadEventExecutor.execute(Runnable), ornullif default one should be used.tailTaskQueueFactory- theEventLoopTaskQueueFactoryto use forSingleThreadEventLoop.executeAfterEventLoopIteration(Runnable), ornullif default one should be used.
-
-
Method Details
-
setIoRatio
public void setIoRatio(int ioRatio) Sets the percentage of the desired amount of time spent for I/O in the child event loops. The default value is50, which means the event loop will try to spend the same amount of time for I/O as for non-I/O tasks. -
rebuildSelectors
-
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 classMultithreadEventLoopGroup- Throws:
Exception
-