Thanks for your answer. What I meant is calling the asynchronous API with a cq that has been shut down. It seems to me that it would be nicer if the grpc library has some way to report such an error, say maybe returning a null unique_ptr of async reader when an event is added after cq is shut down. But for now I'll add my own synchronization to prevent this.
Best, Chun-Hung On Friday, July 28, 2017 at 10:03:09 AM UTC-7, Yang Gao wrote: > > It is not clear to me what you meant by post an async rpc request to a cq. > However, the user of a cq needs to guarantee that no new event is added to > the cq after a shutdown is called. As a result, you most likely need some > of your own synchronization. > Thanks. > > On Thursday, July 27, 2017 at 12:04:36 PM UTC-7, [email protected] > wrote: >> >> Hi all, >> >> I was wondering that, if I post an asynchronous RPC request to a >> `CompletionQueue` that has been shutdown, >> how can I tell from the return value for error handling? >> I'm asking this because the asynchronous request and the `Shutdown()` >> call might happen >> in two different threads, and since the `CompletionQueue` is thread-safe, >> I'm thinking if I can avoid introducing my own synchronization variables >> and >> rely on the result of the asynchronous call to avoid concurrency issues. >> >> Thanks, >> Chun-Hung >> > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/c388c152-b744-4fa9-8fd2-945aac16af4d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
