Have a look at this discussion: 
https://groups.google.com/forum/#!topic/grpc-io/hahFSzQBN4s . Hope it helps.

On Thursday, November 1, 2018 at 8:42:42 AM UTC+5:30, 
michi....@crowdstrike.com wrote:
>
> I have a C++ client that reads data from a stream using a ClientReader. 
> The client runs a separate thread that effectively does:
>
> while (reader_stream->Read(buf)) {
>     // Do something with buf
> }
>
> This works just fine, no problem.
>
> At some point, my process receives a message from an external program (not 
> via gRPC) that instructs it to shut down. The problem is that I can't exit 
> from the read loop because the client thread is stuck in its Read() call, 
> and the server may not send another message for hours.
>
> I need to cancel the Read() call from another thread in my client, but I 
> can't find anything in the API to do this. What am I missing?
>
> Thanks,
>
> Michi.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/14edc4fb-7ec1-427f-bc97-c68c21ade8a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to