implement basic FlowControlManager

This commit is contained in:
Marten Seemann
2016-06-15 18:53:54 +07:00
parent 37e57c6f05
commit 800320ec39
5 changed files with 250 additions and 5 deletions

View File

@@ -15,3 +15,12 @@ type FlowController interface {
CheckFlowControlViolation() bool
GetHighestReceived() protocol.ByteCount
}
// A FlowControlManager manages the flow control
type FlowControlManager interface {
NewStream(streamID protocol.StreamID, contributesToConnectionFlow bool)
UpdateHighestReceived(streamID protocol.StreamID, byteOffset protocol.ByteCount) error
AddBytesRead(streamID protocol.StreamID, n protocol.ByteCount) error
MaybeTriggerStreamWindowUpdate(streamID protocol.StreamID) (bool, protocol.ByteCount, error)
MaybeTriggerConnectionWindowUpdate() (bool, protocol.ByteCount)
}