Hi there and thanks for reading.
I am working on a solution using gRPC in which my end goal is to provide an RPC service method that clients can call once to subscribe to a stream of event messages. I am using the async model and want to manage my own thread pool in order to support multiple clients across multiple platforms and languages.
I have looked at the following examples from the gRPC source repository:
test/cpp/server_async
test/cpp/end2end/async_end2end_test.cc
and the helloworld async example.
After looking through these I am having trouble understanding how to loop somewhere in the handling of my stream RPC in order to wait for additional events to send on the client stream. It seems in most of these examples a limited number of messages are sent to the stream and then the Finish() method is called which terminates the RPC. My use case requires me to send events only periodically. I would like for my stream to remain open until the client disconnects and am also trying to understand how it is possible to detect a disconnection.