use of io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup in project sofa-rpc by sofastack.
the class TripleServer method constructWorkerEventLoopGroup.
private EventLoopGroup constructWorkerEventLoopGroup() {
int workerThreads = serverConfig.getIoThreads();
workerThreads = workerThreads <= 0 ? Runtime.getRuntime().availableProcessors() * 2 : workerThreads;
NamedThreadFactory threadName = new NamedThreadFactory("SEV-WORKER-" + serverConfig.getPort(), serverConfig.isDaemon());
EventLoopGroup workerGroup = serverConfig.isEpoll() ? new EpollEventLoopGroup(workerThreads, threadName) : new NioEventLoopGroup(workerThreads, threadName);
return workerGroup;
}
use of io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup in project sofa-rpc by sofastack.
the class TripleServer method constructBossEventLoopGroup.
/**
* default as bolt
*
* @return
*/
private EventLoopGroup constructBossEventLoopGroup() {
NamedThreadFactory threadName = new NamedThreadFactory("SEV-BOSS-" + serverConfig.getPort(), serverConfig.isDaemon());
EventLoopGroup bossGroup = serverConfig.isEpoll() ? new EpollEventLoopGroup(1, threadName) : new NioEventLoopGroup(1, threadName);
return bossGroup;
}
Aggregations