[#5763] DefaultEventLoopGroup doesn't expose ctor variant that accepts custom Executor

Motivation:

The DefaultEventLoopGroup class extends MultithreadEventExecutorGroup but doesn't expose the ctor variants that accept a custom Executor like NioEventLoopGroup and EpollEventLoopGroup do.

Modifications:

Add missing constructor.

Result:

Be able to use custom Executor with DefaultEventLoopGroup.
This commit is contained in:
Norman Maurer 2016-08-30 06:40:42 +02:00
parent eb450d8b2f
commit 6fd8bb8c63

View File

@ -36,7 +36,7 @@ public class DefaultEventLoopGroup extends MultithreadEventLoopGroup {
* @param nThreads the number of threads to use
*/
public DefaultEventLoopGroup(int nThreads) {
this(nThreads, null);
this(nThreads, (ThreadFactory) null);
}
/**
@ -49,6 +49,16 @@ public class DefaultEventLoopGroup extends MultithreadEventLoopGroup {
super(nThreads, threadFactory);
}
/**
* Create a new instance
*
* @param nThreads the number of threads to use
* @param executor the Executor to use, or {@code null} if the default should be used.
*/
public DefaultEventLoopGroup(int nThreads, Executor executor) {
super(nThreads, executor);
}
@Override
protected EventLoop newChild(Executor executor, Object... args) throws Exception {
return new DefaultEventLoop(this, executor);