forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: move send-side flow control to Channel
AsyncChannel and ProtocolChannel each have their own version of some very-similar looking flow control code. Let's unify those and move them to the base Channel type before we go and add yet another copy. All channels ought to support flow control anyway. Rename the constants to BLOCK_SIZE and SEND_WINDOW to make them more accessible (and meaningful) to subclasses. In particular, BLOCK_SIZE is the size of blocks that channel implementations should aim to send. Add some docs as well, and implement the 'flow-control' option (it was missing for ProtocolChannel). Note: we don't do the same with receive-side flow control because it's easier to implement (no windowing algorithm — just reply to pings) and also because the two implementations we have are very different so we can't really share code.
- Loading branch information
1 parent
0d6754f
commit 8d980ba
Showing
1 changed file
with
60 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters