Class EpollEventLoopGroup
java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.channel.MultithreadEventLoopGroup
io.netty.channel.epoll.EpollEventLoopGroup
- All Implemented Interfaces:
EventLoopGroup, EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
EventLoopGroup which uses epoll under the covers. Because of this
it only works on linux.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance using the default number of threads and the defaultThreadFactory.EpollEventLoopGroup(int nThreads) Create a new instance using the specified number of threads and the defaultThreadFactory.EpollEventLoopGroup(int nThreads, SelectStrategyFactory selectStrategyFactory) Create a new instance using the specified number of threads and the defaultThreadFactory.EpollEventLoopGroup(int nThreads, Executor executor) EpollEventLoopGroup(int nThreads, Executor executor, SelectStrategyFactory selectStrategyFactory) EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory) EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler) EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory queueFactory) EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory) Create a new instance using the specified number of threads and the givenThreadFactory.EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce) Deprecated.EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce, SelectStrategyFactory selectStrategyFactory) EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectStrategyFactory selectStrategyFactory) Create a new instance using the specified number of threads and the givenThreadFactory.EpollEventLoopGroup(ThreadFactory threadFactory) Create a new instance using the default number of threads and the givenThreadFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected EventLoopCreate a new EventExecutor which will later then accessible via theMultithreadEventExecutorGroup.next()method.voidsetIoRatio(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, registerModifier and TypeMethodDescriptionprotected ThreadFactorynext()Returns one of theEventExecutors managed by thisEventExecutorGroup.register(ChannelPromise promise) register(Channel channel, ChannelPromise promise) Deprecated.Methods inherited from class MultithreadEventExecutorGroup
awaitTermination, executorCount, isShutdown, isShuttingDown, isTerminated, iterator, 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()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.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
-
EpollEventLoopGroup
public EpollEventLoopGroup()Create a new instance using the default number of threads and the defaultThreadFactory. -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads) Create a new instance using the specified number of threads and the defaultThreadFactory. -
EpollEventLoopGroup
Create a new instance using the default number of threads and the givenThreadFactory. -
EpollEventLoopGroup
Create a new instance using the specified number of threads and the defaultThreadFactory. -
EpollEventLoopGroup
Create a new instance using the specified number of threads and the givenThreadFactory. -
EpollEventLoopGroup
-
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectStrategyFactory selectStrategyFactory) Create a new instance using the specified number of threads and the givenThreadFactory. -
EpollEventLoopGroup
@Deprecated public EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce) Deprecated.Create a new instance using the specified number of threads, the givenThreadFactoryand the given maximal amount of epoll events to handle per epollWait(...). -
EpollEventLoopGroup
@Deprecated public EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce, SelectStrategyFactory selectStrategyFactory) Deprecated.Create a new instance using the specified number of threads, the givenThreadFactoryand the given maximal amount of epoll events to handle per epollWait(...). -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, Executor executor, SelectStrategyFactory selectStrategyFactory) -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory) -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler) -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory queueFactory) -
EpollEventLoopGroup
public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, 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.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. -
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
-
EpollEventLoopGroup(int)orEpollEventLoopGroup(int, ThreadFactory)