public class NioEventLoopGroup extends MultithreadEventLoopGroup
Constructor and Description |
---|
NioEventLoopGroup()
Create a new instance that uses twice as many
EventLoop s as there processors/cores
available, as well as the default Executor and the SelectorProvider which
is returned by SelectorProvider.provider() . |
NioEventLoopGroup(int nEventLoops)
Create a new instance that uses the default
Executor and the SelectorProvider which
is returned by SelectorProvider.provider() . |
NioEventLoopGroup(int nEventLoops,
Executor executor)
Create a new instance that uses the the
SelectorProvider which is returned by
SelectorProvider.provider() . |
NioEventLoopGroup(int nEventLoops,
Executor executor,
SelectorProvider selectorProvider) |
NioEventLoopGroup(int nEventLoops,
ExecutorServiceFactory executorServiceFactory)
Create a new instance that uses the the
SelectorProvider which is returned by
SelectorProvider.provider() . |
NioEventLoopGroup(int nEventLoops,
ExecutorServiceFactory executorServiceFactory,
SelectorProvider selectorProvider) |
Modifier and Type | Method and Description |
---|---|
protected EventLoop |
newChild(Executor executor,
Object... args)
Create a new EventExecutor which will later then accessible via the
MultithreadEventExecutorGroup.next() method. |
void |
rebuildSelectors()
|
void |
setIoRatio(int ioRatio)
Sets the percentage of the desired amount of time spent for I/O in the child event loops.
|
next, register, register
awaitTermination, children, executorCount, isShutdown, isShuttingDown, isTerminated, newDefaultExecutorService, shutdown, shutdownGracefully, terminationFuture
close, execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
children, isShuttingDown, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFuture
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
close
public NioEventLoopGroup()
EventLoop
s as there processors/cores
available, as well as the default Executor
and the SelectorProvider
which
is returned by SelectorProvider.provider()
.DefaultExecutorServiceFactory
public NioEventLoopGroup(int nEventLoops)
Executor
and the SelectorProvider
which
is returned by SelectorProvider.provider()
.nEventLoops
- the number of EventLoop
s that will be used by this instance.
If executor
is null
this number will also be the parallelism
requested from the default executor. It is generally advised for the number
of EventLoop
s and the number of Thread
s used by theDefaultExecutorServiceFactory
public NioEventLoopGroup(int nEventLoops, Executor executor)
SelectorProvider
which is returned by
SelectorProvider.provider()
.nEventLoops
- the number of EventLoop
s that will be used by this instance.
If executor
is null
this number will also be the parallelism
requested from the default executor. It is generally advised for the number
of EventLoop
s and the number of Thread
s used by the
executor
to lie very close together.executor
- the Executor
to use, or null
if the default should be used.public NioEventLoopGroup(int nEventLoops, ExecutorServiceFactory executorServiceFactory)
SelectorProvider
which is returned by
SelectorProvider.provider()
.nEventLoops
- the number of EventLoop
s that will be used by this instance.
If executor
is null
this number will also be the parallelism
requested from the default executor. It is generally advised for the number
of EventLoop
s and the number of Thread
s used by the
executor
to lie very close together.executorServiceFactory
- the ExecutorServiceFactory
to use, or null
if the default
should be used.public NioEventLoopGroup(int nEventLoops, Executor executor, SelectorProvider selectorProvider)
nEventLoops
- the number of EventLoop
s that will be used by this instance.
If executor
is null
this number will also be the parallelism
requested from the default executor. It is generally advised for the number
of EventLoop
s and the number of Thread
s used by the
executor
to lie very close together.executor
- the Executor
to use, or null
if the default should be used.selectorProvider
- the SelectorProvider
to use. This value must not be null
.public NioEventLoopGroup(int nEventLoops, ExecutorServiceFactory executorServiceFactory, SelectorProvider selectorProvider)
nEventLoops
- the number of EventLoop
s that will be used by this instance.
If executor
is null
this number will also be the parallelism
requested from the default executor. It is generally advised for the number
of EventLoop
s and the number of Thread
s used by the
executor
to lie very close together.executorServiceFactory
- the ExecutorServiceFactory
to use, or null
if the
default should be used.selectorProvider
- the SelectorProvider
to use. This value must not be null
.public void setIoRatio(int ioRatio)
50
, which means the event loop will try to spend the same amount of time for I/O as for non-I/O tasks.public void rebuildSelectors()
protected EventLoop newChild(Executor executor, Object... args) throws Exception
MultithreadEventExecutorGroup
MultithreadEventExecutorGroup.next()
method. This method will be
called for each thread that will serve this MultithreadEventExecutorGroup
.newChild
in class MultithreadEventLoopGroup
Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.