Sidharth Ramalingam
11/05/2025, 6:12 AMAsyncIO function with Futures to make external gRPC calls. Currently, we have set the async capacity to 1, and we are using a blocking stub to make those calls. For each event, we trigger 4 Futures (i.e., 4 gRPC calls per event).
Does this mean that the Executors.newFixedThreadPool() needs to have at least 4 threads to avoid queue starvation? Also, if we increase the async capacity to 2, should we increase the thread pool size to 8 to keep up with the parallel calls?Rion Williams
11/06/2025, 2:16 PM(capacity) * (calls per event)
The above formula would scale based on the capacity. So in your example case, you'd likely want a minimum of 4 threads and if you increased the capacity to 2, then you'd scale that up further to a minimum of 8 threads.Sidharth Ramalingam
11/07/2025, 7:14 AM