New send flow control (#25)
Restructure send flow control such that sending data is always accepted by `Stream`. Data frames will be buffered until there is available window to send them. Producers can monitor the available window capacity to decide if data should be produced.
This commit is contained in:
@@ -74,6 +74,11 @@ fn send_recv_data() {
|
||||
info!("sending request");
|
||||
let mut stream = h2.request(request, false).unwrap();
|
||||
|
||||
// Reserve send capacity
|
||||
stream.reserve_capacity(5).unwrap();
|
||||
|
||||
assert_eq!(stream.capacity(), 5);
|
||||
|
||||
// Send the data
|
||||
stream.send_data("hello", true).unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user