grpc-java uses an executor in its ServerBuilder
, which if not defined by the builder.executor()
method, uses a static cached thread pool by default. What is the exact use of this executor? Does it just execute the handler methods or does it do “something else” as well?
Also, how does grpc define the netty worker EventLoopGroup
? Specifically, I want to know how the worker threads are assigned to this worker group. Is there a default for the number of threads, or is it a function of the number of cores of the machine? Also, in relation to the above question, how do these netty workers work with the executor? Do they handle just the I/O - reading and writing to the channel?
Edit: Netty, by default creates (2 * number of cores) worker threads.