Hi Arpit, I had a couple follow-up questions:

I'm looking at your code and mine, and how multiple services might be 
supported. It seems like the "Request*" function is the one that blocks on 
a service type, and you essentially need to have create a different 
CallData (or TagInfo in your case) for every type of Service. Is that 
right? I only want to have a single thread handling the requests coming in, 
so I believe I should make a new CallData/TagInfo for every type of Service 
I have at the start, then sit in a busy loop on my only thread calling Next 
on the completion queue. It seems like the cleanest way to do that is 
something similar to what you have, where every Service type implements its 
own CallData/TagInfo class to do the processing it needs to do for each 
function. Does all this sound okay?


On Thursday, July 20, 2017 at 1:43:13 PM UTC-7, Arpit Baldeva wrote:
>
> You can add as many services as you like to a single server (using 
> RegisterService call).
>
> Check out the following post for a better (but complicated sample) 
> https://groups.google.com/forum/#!topic/grpc-io/DuBDpK96B14 . It does not 
> show multiple services but that part is not complicated. 
>
> On Wednesday, July 19, 2017 at 8:32:35 PM UTC-7, [email protected] wrote:
>>
>> Hi, I'm trying to understand how to convert an application using 
>> synchronous RPC to asynchronous. My old method for synchronous 
>> communication was calling RegisterService on all my services, then calling 
>> Wait() on the server after it was created. The gRPC library would decide 
>> which Service function to call from that point. 
>>
>> When I look at the async C++ example, the beginning looks very similar 
>> where the services are added, and BuildAndStart is called. But instead of 
>> calling Wait(). HandleRpcs is called as the busy loop. However, it looks 
>> like HandleRpcs is only handling a single type of service. I don't see any 
>> examples of adding multiple services anywhere, so I'm not sure how that's 
>> handled. Does it imply that I would have to make essentially a separate 
>> ServerImpl class for every type of service?
>>
>

-- 
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/6a580f32-db04-4f1f-8299-e91024db08cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to