mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
bpo-46487: Add get_write_buffer_limits
to Write and _SSLProtocol transports (GH-30958)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
0e4bef7a7f
commit
64568acbd8
3 changed files with 13 additions and 0 deletions
|
@ -367,6 +367,12 @@ class _SSLProtocolTransport(transports._FlowControlMixin,
|
||||||
"""Return the current size of the write buffer."""
|
"""Return the current size of the write buffer."""
|
||||||
return self._ssl_protocol._transport.get_write_buffer_size()
|
return self._ssl_protocol._transport.get_write_buffer_size()
|
||||||
|
|
||||||
|
def get_write_buffer_limits(self):
|
||||||
|
"""Get the high and low watermarks for write flow control.
|
||||||
|
Return a tuple (low, high) where low and high are
|
||||||
|
positive number of bytes."""
|
||||||
|
return self._ssl_protocol._transport.get_write_buffer_limits()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _protocol_paused(self):
|
def _protocol_paused(self):
|
||||||
# Required for sendfile fallback pause_writing/resume_writing logic
|
# Required for sendfile fallback pause_writing/resume_writing logic
|
||||||
|
|
|
@ -99,6 +99,12 @@ class WriteTransport(BaseTransport):
|
||||||
"""Return the current size of the write buffer."""
|
"""Return the current size of the write buffer."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def get_write_buffer_limits(self):
|
||||||
|
"""Get the high and low watermarks for write flow control.
|
||||||
|
Return a tuple (low, high) where low and high are
|
||||||
|
positive number of bytes."""
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
"""Write some data bytes to the transport.
|
"""Write some data bytes to the transport.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add the ``get_write_buffer_limits`` method to :class:`asyncio.transports.WriteTransport` and to the SSL transport.
|
Loading…
Add table
Add a link
Reference in a new issue