Address feedback on ControlFlow and FlowControl

ControlFlow::poll_window_update now exposes, effectively, a Stream of
WindowUpdates.  Callers no longer poll on invidual stream IDs. To
accomplish this, FlowControl maintains a queue of pending remote stream
ids.

Improve/shorten naming throughout FlowControl.

FlowControlState::check_window has been added so that FlowControl is now
consistent in the face of stream-level flow control errors.

Connection now exposes the ControlFlow functions without exposing the
ControlFlow interface publicly.
This commit is contained in:
Oliver Gould
2017-07-18 19:32:26 +00:00
parent 50545963c9
commit df589f2fde
8 changed files with 144 additions and 107 deletions

View File

@@ -110,12 +110,12 @@ impl<T: ControlStreams> ControlStreams for Settings<T> {
}
impl<T: ControlFlow> ControlFlow for Settings<T> {
fn poll_remote_window_update(&mut self, id: StreamId) -> Poll<WindowSize, ConnectionError> {
self.inner.poll_remote_window_update(id)
fn poll_window_update(&mut self) -> Poll<WindowUpdate, ConnectionError> {
self.inner.poll_window_update()
}
fn expand_local_window(&mut self, id: StreamId, incr: WindowSize) -> Result<(), ConnectionError> {
self.inner.expand_local_window(id, incr)
fn expand_window(&mut self, id: StreamId, incr: WindowSize) -> Result<(), ConnectionError> {
self.inner.expand_window(id, incr)
}
}