RPC level flow control support in grpc for golang

537 views
Skip to first unread message

eld...@gmail.com

unread,
Oct 25, 2017, 8:21:49 AM10/25/17
to grpc.io

Hi,

Is it possible to perform manual flow control in the RPC call level in grpc-go?

I'm looking for something like the flow control mechanism of the grpc library for java:

I would like my clients/servers to have the option to specify for the other side whatever they are ready to receive new messages or not.

I looked for this functionality in grpc-go documentation and the source code but only found option to tune the window size of the http2 transport layer.
Is this functionality implemented in grpc-go?

Best,
Eldad.

Josh Humphries

unread,
Oct 26, 2017, 10:47:33 AM10/26/17
to eld...@gmail.com, grpc.io
Since Go's API is synchronous/blocking, I am pretty sure that sender always block until message is actually sent, which will respect HTTP/2 flow control windows.

If you want an async API, where a sender can queue up messages even before the receiver can accept them, you could push them into a buffered channel and have another goroutine that is de-queueing from the channel and writing to the receiver as allowed by flow control.

Java is different because its API is completely async and non-blocking. So backpressure requires more sophistication in the app code.

----
Josh Humphries
jh...@bluegosling.com

--
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+unsubscribe@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/c2b0653a-3ba5-4fd6-9164-dd1432c2af16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages