rsocket / rsocket-java

Java implementation of RSocket
http://rsocket.io
Apache License 2.0
2.35k stars 354 forks source link

Ability to limit number of open requests at transport level #1065

Open rstoyanchev opened 2 years ago

rstoyanchev commented 2 years ago

Lease frames allow a responder to control the total number of requests from the other end, but it is an optional feature, and there should also be a way to limit the total number of requests at the transport level.

For the implementation, subscribers created by RSocketResponder will need a callback on DuplexConnection#sendFrame to notify them when those frames have been sent. This will allow them to keep track of the number of open requests. It will also enable keeping track of and limiting the overall number of messages buffered per stream.