grpc Async Client

70 views
Skip to first unread message

mauricio...@lacity.org

unread,
Sep 20, 2018, 6:40:53 PM9/20/18
to grpc.io
I'm working on a project where I have a client that needs to send the same data to multiple servers.  I encountered a situation where one of the servers was slow in responding.  It seemed like the slow server caused us to block until its message had been sent which slowed down the sending of data to the other servers.  This led me down the road of exploring the async call.  

I took the helloworld async client and server samples and spun up three instances of the servers (each on a separate port, but same machine).  The second instance had a 1-second sleep.  I then created a client that sends the same message to all three servers and I was expecting the servers to reply out of order 1, 3, then 2 since I put a sleep in the second one.  I get the replies in order, which seems to defeat the purpose of the async call.  

Am I misunderstanding how the async calls should behave?  Is there maybe another way to solve this issue?

Carl Mastrangelo

unread,
Sep 21, 2018, 7:25:49 PM9/21/18
to grpc.io
What language are you using?

mauricio...@lacity.org

unread,
Sep 24, 2018, 9:20:03 AM9/24/18
to grpc.io
I'm using C++

Arthur Wang

unread,
Sep 26, 2018, 8:11:12 AM9/26/18
to mauricio...@lacity.org, grp...@googlegroups.com
Hi mauricio :

I'm also using c++ version of gRPC 1.8.x. And I didn't encounter your problem.   I spawned 3 instance of server which sleep 3s/1s/1s respectively, and the client start requesting in an asynchronous manner,  received response from  the last two instances after 1 second , then received from the first server's after 3 seconds , all things went well without any unexpected behaviors.

- Regards

--
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/b748aedb-a3d1-4dd4-9917-7aeac4040ae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages