What you are describing is a normal thing to do with gRPC, using either unary or streaming methods. Each of those operations is independent and can be started independently, and then when they finish you can aggregate the results. The exact way to do this depends on what features the specific programming language has for handling asynchronous operations. What language do you expect to do this in?
On Mon, Sep 21, 2020 at 5:54 AM Nicholas Bunn <[email protected]> wrote: > Hi there, I'm developing an application which will aggregate information > from various services and return it to the client. The system will be > distributed and I'd like to implement asynchronous communication where > possible to avoid lengthy processes stalling the system. > > I think I understand the "asynchronous" implementation of gRPC in terms of > streaming, where it's asynchronous considering that you don't necessarily > wait for the invoked service to complete its process before getting a > response. I'm looking for the non-blocking aspects of asynchronous > communication, so considering the explanation below - I hope someone can > provide some insight for me. > > Say there exists some aggregating service and four other services from > which it will be collecting information (services A, B, C, and D). With > standard synchronous calls, the aggregating service would have to query > service A, wait for a response, then query service B, wait for a response, > and so on. What I am looking for is a way to query all four services in > parallel and wait for a callback or notification from each one once they > have completed their process, and their information is available. Would one > be able to achieve this with streaming? Or is the client still limited to > communication with one server at a time (essentially implementing a > blocking call)? > > Any assistance/insight would be greatly appreciated! > > Thanks, > Nic > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/bc93f296-f129-4f23-a4a7-d76e820d28a5n%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/bc93f296-f129-4f23-a4a7-d76e820d28a5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAPK2-4fCAefGsZHfbdog2rN_i6N7fLD_RgNz1n_krd2QA%3DfTYQ%40mail.gmail.com.
