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/f12d3cb9-cf1e-4a09-a9ce-706368c1c08d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
