Hi everyone,
I'm trying to integrate gRPC in my application and I'm having some issues. This is mostly the workflow I have in my app:
1. a thread that does a bunch of different things
2. every second reads gRPC response of the request sent last second
3. at the same time it sends a new gRPC request to another process
It's very important for us that every second we read the response calculated by the other process. What I did so far is:
1. use AsyncNext with timeout 0 on CompletionQueue to read any data available
2. Compose a new request and send it via Stub::AsyncSayHello and Finish()
But it does not quite work, basically the server responds immediately but the first call to AsyncNext just gives a timeout, calling again AsyncNext instead gives the response.
My questions is: Isn't there any API that allows to *read anything you can from the socket*?
I can also just call AsyncNext multiple times until it's done but how can I know that there is yet something else to parse if I just receive TIMEOUT?
My understanding is that I just need to call AsyncNext to keep things going, how do you suggest to implement this? Like having a different thread just doing AsyncNext for all my gRPC calls?
Anybody that can explain this behaviour better to me would be very appreciated, I'll be happy to send PR to update documentation if afterwards if needed.
Thanks,
Luca