> However, HandleRpc() only call proceed() once,. It seems we always stay 
in the PROCESS state. Will it generate the memory leak?

No, the same CallData object is used multiple times as a completion queue 
tag, allowing the state to progress.

> What does it mean to have cq->next(&tag, &ok) return the out param ok as 
false? 

A `false` value for `ok` signifies a failure to read a successful event, 
but the documentation already mentions that. Do you have a more specific 
question that you have in mind?
On Sunday, May 30, 2021 at 12:44:25 PM UTC-7 Mohan Gyara wrote:

> What does it mean to have cq->next(&tag, &ok) return the out param ok as 
> false? 
> I appreciate if someone answer this. 
>
> Regards,
> Mohan
>
> On Thursday, 5 November 2015 at 08:48:33 UTC+5:30 hardy wrote:
>
>> Is there anyone familiar with CompleteQueue could tell me how the 
>> mechanism is? The only piece of codes I can found is 
>>
>>   void HandleRpcs() {
>>     // Spawn a new CallData instance to serve new clients.
>>     new CallData(&service_, cq_.get());
>>     void* tag;  // uniquely identifies a request.
>>     bool ok;
>>     while (true) {
>>       // Block waiting to read the next event from the completion queue. 
>> The
>>       // event is uniquely identified by its tag, which in this case is 
>> the
>>       // memory address of a CallData instance.
>>       cq_->Next(&tag, &ok);
>>       GPR_ASSERT(ok);
>>       static_cast<CallData*>(tag)->Proceed();
>>     }
>>   }
>>
>>
>> I really would like to know how I could response to different kinds of 
>> request? And will the loop keep iterating over the CompleteQueue again and 
>> again?
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/04221c3d-b036-4f33-be64-24e56e065c0fn%40googlegroups.com.

Reply via email to