Skip to content

Commit 64568ac

Browse files
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>
1 parent 0e4bef7 commit 64568ac

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Lib/asyncio/sslproto.py

+6
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ def get_write_buffer_size(self):
367367
"""Return the current size of the write buffer."""
368368
return self._ssl_protocol._transport.get_write_buffer_size()
369369

370+
def get_write_buffer_limits(self):
371+
"""Get the high and low watermarks for write flow control.
372+
Return a tuple (low, high) where low and high are
373+
positive number of bytes."""
374+
return self._ssl_protocol._transport.get_write_buffer_limits()
375+
370376
@property
371377
def _protocol_paused(self):
372378
# Required for sendfile fallback pause_writing/resume_writing logic

Lib/asyncio/transports.py

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ def get_write_buffer_size(self):
9999
"""Return the current size of the write buffer."""
100100
raise NotImplementedError
101101

102+
def get_write_buffer_limits(self):
103+
"""Get the high and low watermarks for write flow control.
104+
Return a tuple (low, high) where low and high are
105+
positive number of bytes."""
106+
raise NotImplementedError
107+
102108
def write(self, data):
103109
"""Write some data bytes to the transport.
104110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the ``get_write_buffer_limits`` method to :class:`asyncio.transports.WriteTransport` and to the SSL transport.

0 commit comments

Comments
 (0)