Search in sources :

Example 1 with RejectedExecutionHandler

use of io.netty.util.concurrent.RejectedExecutionHandler in project netty by netty.

the class NioEventLoopGroup method newChild.

@Override
protected EventLoop newChild(Executor executor, Object... args) throws Exception {
    SelectorProvider selectorProvider = (SelectorProvider) args[0];
    SelectStrategyFactory selectStrategyFactory = (SelectStrategyFactory) args[1];
    RejectedExecutionHandler rejectedExecutionHandler = (RejectedExecutionHandler) args[2];
    EventLoopTaskQueueFactory taskQueueFactory = null;
    EventLoopTaskQueueFactory tailTaskQueueFactory = null;
    int argsLength = args.length;
    if (argsLength > 3) {
        taskQueueFactory = (EventLoopTaskQueueFactory) args[3];
    }
    if (argsLength > 4) {
        tailTaskQueueFactory = (EventLoopTaskQueueFactory) args[4];
    }
    return new NioEventLoop(this, executor, selectorProvider, selectStrategyFactory.newSelectStrategy(), rejectedExecutionHandler, taskQueueFactory, tailTaskQueueFactory);
}
Also used : EventLoopTaskQueueFactory(io.netty.channel.EventLoopTaskQueueFactory) DefaultSelectStrategyFactory(io.netty.channel.DefaultSelectStrategyFactory) SelectStrategyFactory(io.netty.channel.SelectStrategyFactory) SelectorProvider(java.nio.channels.spi.SelectorProvider) RejectedExecutionHandler(io.netty.util.concurrent.RejectedExecutionHandler)

Example 2 with RejectedExecutionHandler

use of io.netty.util.concurrent.RejectedExecutionHandler in project netty by netty.

the class KQueueEventLoopGroup method newChild.

@Override
protected EventLoop newChild(Executor executor, Object... args) throws Exception {
    Integer maxEvents = (Integer) args[0];
    SelectStrategyFactory selectStrategyFactory = (SelectStrategyFactory) args[1];
    RejectedExecutionHandler rejectedExecutionHandler = (RejectedExecutionHandler) args[2];
    EventLoopTaskQueueFactory taskQueueFactory = null;
    EventLoopTaskQueueFactory tailTaskQueueFactory = null;
    int argsLength = args.length;
    if (argsLength > 3) {
        taskQueueFactory = (EventLoopTaskQueueFactory) args[3];
    }
    if (argsLength > 4) {
        tailTaskQueueFactory = (EventLoopTaskQueueFactory) args[4];
    }
    return new KQueueEventLoop(this, executor, maxEvents, selectStrategyFactory.newSelectStrategy(), rejectedExecutionHandler, taskQueueFactory, tailTaskQueueFactory);
}
Also used : EventLoopTaskQueueFactory(io.netty.channel.EventLoopTaskQueueFactory) DefaultSelectStrategyFactory(io.netty.channel.DefaultSelectStrategyFactory) SelectStrategyFactory(io.netty.channel.SelectStrategyFactory) RejectedExecutionHandler(io.netty.util.concurrent.RejectedExecutionHandler)

Example 3 with RejectedExecutionHandler

use of io.netty.util.concurrent.RejectedExecutionHandler in project netty by netty.

the class EpollEventLoopGroup method newChild.

@Override
protected EventLoop newChild(Executor executor, Object... args) throws Exception {
    Integer maxEvents = (Integer) args[0];
    SelectStrategyFactory selectStrategyFactory = (SelectStrategyFactory) args[1];
    RejectedExecutionHandler rejectedExecutionHandler = (RejectedExecutionHandler) args[2];
    EventLoopTaskQueueFactory taskQueueFactory = null;
    EventLoopTaskQueueFactory tailTaskQueueFactory = null;
    int argsLength = args.length;
    if (argsLength > 3) {
        taskQueueFactory = (EventLoopTaskQueueFactory) args[3];
    }
    if (argsLength > 4) {
        tailTaskQueueFactory = (EventLoopTaskQueueFactory) args[4];
    }
    return new EpollEventLoop(this, executor, maxEvents, selectStrategyFactory.newSelectStrategy(), rejectedExecutionHandler, taskQueueFactory, tailTaskQueueFactory);
}
Also used : EventLoopTaskQueueFactory(io.netty.channel.EventLoopTaskQueueFactory) DefaultSelectStrategyFactory(io.netty.channel.DefaultSelectStrategyFactory) SelectStrategyFactory(io.netty.channel.SelectStrategyFactory) RejectedExecutionHandler(io.netty.util.concurrent.RejectedExecutionHandler)

Aggregations

DefaultSelectStrategyFactory (io.netty.channel.DefaultSelectStrategyFactory)3 EventLoopTaskQueueFactory (io.netty.channel.EventLoopTaskQueueFactory)3 SelectStrategyFactory (io.netty.channel.SelectStrategyFactory)3 RejectedExecutionHandler (io.netty.util.concurrent.RejectedExecutionHandler)3 SelectorProvider (java.nio.channels.spi.SelectorProvider)1