Clarifications on asynch reactor pattern

64 views
Skip to first unread message

Alex Drastico

unread,
Oct 24, 2024, 10:30:18 AM10/24/24
to grpc.io
Hi,
we are evaluating gRPC for our new microservices and would like some clarifications about the C++ (asynch) callback API. 

The docs suggest that "reactions should be fast", which generally is indication of single threaded execution and therefore avoid heavy processing as that would be blocking the main thread. But then it also says that "reactions can run in parallel", which seems to suggest they are executed concurrently. So we have the following questions:

1. Does gRPC's reactor pattern implementation in C++ use a single thread to execute the reactions or are the reactors being executed in dedicated "worker" threads?

2. Can someone provide a brief description of how the reactor pattern is implemented in the C++ API? Or point to some relevant docs as we were not able to find much info in this regard.

Thanks

yas...@google.com

unread,
Oct 30, 2024, 3:45:20 PM10/30/24
to grpc.io
The idea is that there are a bunch of threads that gRPC maintains for the execution of callbacks. The same threads can also be used for operations that gRPC needs to perform like polling, reading and writing.

You would find detailed information on the callback API through the following links - 
Reply all
Reply to author
Forward
0 new messages