Using a single CompletionQueue for server and client objects

28 views
Skip to first unread message

adam....@gmail.com

unread,
Oct 18, 2016, 3:59:38 PM10/18/16
to grpc.io
Hi,

I'm implementing a distributed system and it seems that gRPC would be a great fit for my project. However I have quite simple problem: can a single CompletionQueue be used both for listening for incoming RPC calls to a local server, and for responses to RPC calls initiated from the process? It would seem to make sense, but I want to make sure it's supported. I would like to avoid having separate queues, and doing active polling on them. My system is completely decentralised, and I need to have each node both send and respond to requests from other nodes simultaneously.

My communication protocol is divided into three phases:
1. Node A picks another one (B) in a partially random fashion and sends a small request to it
2. Node B responds with requested data and also requests some additional information from A
3. Node A responds with the information

However, since there's no hierarchy, both A and B should be able to start this cycle.

Thanks,
Adam Paszke

Michael Lumish

unread,
Oct 18, 2016, 4:03:14 PM10/18/16
to adam....@gmail.com, grpc.io
Yes, you can do that. In fact, the Node.js library automatically uses a single completion queue for all operations and it is able to handle any number of simultaneous clients and servers (in principle).

--
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+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
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/43bab32b-9c38-47d9-9e06-a8921a362bb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Paszke

unread,
Oct 18, 2016, 4:24:32 PM10/18/16
to Michael Lumish, grpc.io
That’s great! Thanks for a super quick response!

Best,
Adam

Wiadomość napisana przez Michael Lumish <mlu...@google.com> w dniu 18.10.2016, o godz. 22:03:
Reply all
Reply to author
Forward
0 new messages