@@ -65,14 +65,11 @@ class Utils {
6565 public static final AsciiString TE_HEADER = new AsciiString (HttpUtil .TE .name ());
6666 public static final AsciiString TE_TRAILERS = new AsciiString (HttpUtil .TE_TRAILERS );
6767
68- public static final Resource <EventLoopGroup > DEFAULT_CHANNEL_EVENT_LOOP_GROUP =
69- new DefaultEventLoopGroupResource ("grpc-default-channel-ELG" );
70-
7168 public static final Resource <EventLoopGroup > DEFAULT_BOSS_EVENT_LOOP_GROUP =
72- new DefaultEventLoopGroupResource ("grpc-default-boss-ELG" );
69+ new DefaultEventLoopGroupResource (1 , "grpc-default-boss-ELG" );
7370
7471 public static final Resource <EventLoopGroup > DEFAULT_WORKER_EVENT_LOOP_GROUP =
75- new DefaultEventLoopGroupResource ("grpc-default-worker-ELG" );
72+ new DefaultEventLoopGroupResource (0 , "grpc-default-worker-ELG" );
7673
7774 /**
7875 * Copies the content of the given {@link ByteBuffer} to a new {@link ByteBuf} instance.
@@ -167,14 +164,16 @@ private static Http2Headers convertMetadata(Metadata headers) {
167164
168165 private static class DefaultEventLoopGroupResource implements Resource <EventLoopGroup > {
169166 private final String name ;
167+ private final int nEventLoops ;
170168
171- DefaultEventLoopGroupResource (String name ) {
169+ DefaultEventLoopGroupResource (int nEventLoops , String name ) {
172170 this .name = name ;
171+ this .nEventLoops = nEventLoops ;
173172 }
174173
175174 @ Override
176175 public EventLoopGroup create () {
177- return new NioEventLoopGroup (0 , new ThreadFactoryBuilder ().setNameFormat (name + "-%d" )
176+ return new NioEventLoopGroup (nEventLoops , new ThreadFactoryBuilder ().setNameFormat (name + "-%d" )
178177 .build ());
179178 }
180179
0 commit comments