(gRPC-java) How to limit thread pool size for blocking stub?

48 views
Skip to first unread message

Zareen Syed

unread,
Feb 28, 2019, 7:06:29 PM2/28/19
to grpc.io
Hi,

The method withExecutor() in AbstractStub class mentions that "setting this option may not take effect for blocking calls", is there any other way to configure the number of threads used by the client blocking stub?

Thanks,
Zareen.

Kun Zhang

unread,
Mar 1, 2019, 12:23:55 PM3/1/19
to grpc.io
The executor passed to withExecutor() is used for running callbacks on the response StreamObserver for async stubs. Since there isn't a callback for blocking stub, the executor is not used.

Regardless of blockingness of the stub, there are always network threads (e.g., Netty's EventLoopGroups) under the hood. If you want to configure that, use NettyChannelBuilder.eventLoopGroup().

Zareen Syed

unread,
Mar 1, 2019, 5:48:21 PM3/1/19
to grpc.io
got it, thanks!
Reply all
Reply to author
Forward
0 new messages