Hi,
I am writing a C++ future/promised based interface around the grpc c++ API. Some important details around termination of the streams are not clear to me, even after reading through discussions here and many open/closed issues in the GitHub repository.
Suppose a client calls a SERVER_STREAMING RPC using ClientAsyncReader, ClientContext etc.
Finish()
Can only be called after cq.Next() returns ok = false for a Read() operation. So the normal sequence could look like:
Now suppose the client throws an exception while processing the response returned by the second Read(). From what I understand I have to call ClientContext::TryCancel() and then keep calling Read() until ok = false, then call Finish():
I have a strong feeling it's required to *always* call Finish() before releasing resources, but I have not found any doc/issue/discussion, which confirms it 100%. Is there any other alternative way to terminate the stream in an orderly fashion?
Patrick