diff options
Diffstat (limited to 'Lib/asyncio/transports.py')
-rw-r--r-- | Lib/asyncio/transports.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py index f1a7180..8c6b189 100644 --- a/Lib/asyncio/transports.py +++ b/Lib/asyncio/transports.py @@ -49,6 +49,31 @@ class ReadTransport(BaseTransport): class WriteTransport(BaseTransport): """ABC for write-only transports.""" + def set_write_buffer_limits(self, high=None, low=None): + """Set the high- and low-water limits for write flow control. + + These two values control when to call the protocol's + pause_writing() and resume_writing() methods. If specified, + the low-water limit must be less than or equal to the + high-water limit. Neither value can be negative. + + The defaults are implementation-specific. If only the + high-water limit is given, the low-water limit defaults to a + implementation-specific value less than or equal to the + high-water limit. Setting high to zero forces low to zero as + well, and causes pause_writing() to be called whenever the + buffer becomes non-empty. Setting low to zero causes + resume_writing() to be called only once the buffer is empty. + Use of zero for either limit is generally sub-optimal as it + reduces opportunities for doing I/O and computation + concurrently. + """ + raise NotImplementedError + + def get_write_buffer_size(self): + """Return the current size of the write buffer.""" + raise NotImplementedError + def write(self, data): """Write some data bytes to the transport. |