Add netty epoll
This commit is contained in:
parent
df98b40884
commit
1621bb73ca
@ -71,6 +71,10 @@ public class GrpcServer extends Server {
|
||||
this.grpc = new GrpcServerImpl(this.getClient());
|
||||
EventLoopGroup elg;
|
||||
Class<? extends ServerChannel> channelType;
|
||||
if (http2Port != 0) {
|
||||
elg = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2);
|
||||
channelType = NioServerSocketChannel.class;
|
||||
} else {
|
||||
try {
|
||||
elg = new EpollEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2);
|
||||
channelType = EpollServerDomainSocketChannel.class;
|
||||
@ -79,6 +83,7 @@ public class GrpcServer extends Server {
|
||||
elg = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2);
|
||||
channelType = NioServerSocketChannel.class;
|
||||
}
|
||||
}
|
||||
this.elg = elg;
|
||||
this.executor = Executors.newWorkStealingPool(Runtime.getRuntime().availableProcessors() * 2);
|
||||
this.server = NettyServerBuilder.forAddress(new InetSocketAddress(http2Host, http2Port))
|
||||
|
Loading…
Reference in New Issue
Block a user