How do I apply backpressure from the client side (or connection strength) in tonic to avoid consuming the stream too fast?
I have a server-side streaming RPC server and the stream returned by the function is meant to “drop” intermediate updates (in the sense of not returning the from .next()
) based on how fast .next()
is called, but it seems like the server is calling .next()
in a tight loop regardless of how fast or slow the client is able to consume from it. How can I apply backpressure from the client-side so that .next()
calls are limited by the rate at which the client can consume?