mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: WriteTransport.set_write_buffer_size to call _maybe_pause_protocol
This commit is contained in:
parent
a6919aa4ed
commit
1589920977
2 changed files with 29 additions and 2 deletions
|
@ -241,7 +241,7 @@ class _FlowControlMixin(Transport):
|
|||
def __init__(self, extra=None):
|
||||
super().__init__(extra)
|
||||
self._protocol_paused = False
|
||||
self.set_write_buffer_limits()
|
||||
self._set_write_buffer_limits()
|
||||
|
||||
def _maybe_pause_protocol(self):
|
||||
size = self.get_write_buffer_size()
|
||||
|
@ -273,7 +273,7 @@ class _FlowControlMixin(Transport):
|
|||
'protocol': self._protocol,
|
||||
})
|
||||
|
||||
def set_write_buffer_limits(self, high=None, low=None):
|
||||
def _set_write_buffer_limits(self, high=None, low=None):
|
||||
if high is None:
|
||||
if low is None:
|
||||
high = 64*1024
|
||||
|
@ -287,5 +287,9 @@ class _FlowControlMixin(Transport):
|
|||
self._high_water = high
|
||||
self._low_water = low
|
||||
|
||||
def set_write_buffer_limits(self, high=None, low=None):
|
||||
self._set_write_buffer_limits(high=high, low=low)
|
||||
self._maybe_pause_protocol()
|
||||
|
||||
def get_write_buffer_size(self):
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue