class asyncio.WriteTransport
Interface for write-only transports.
-
abort()
-
Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol’s
connection_lost()
method will eventually be called withNone
as its argument.
-
get_write_buffer_size()
-
Return the current size of the output buffer used by the transport.
-
get_write_buffer_limits()
-
Get the high- and low-water limits for write flow control. Return a tuple
(low, high)
where low and high are positive number of bytes.Use
set_write_buffer_limits()
to set the limits.New in version 3.4.2.
-
set_write_buffer_limits(high=None, low=None)
-
Set the high- and low-water limits for write flow control.
These two values control when call the protocol’s
pause_writing()
andresume_writing()
methods are called. If specified, the low-water limit must be less than or equal to the high-water limit. Neither high nor low can be negative.The defaults are implementation-specific. If only the high-water limit is given, the low-water limit defaults to an 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 causesresume_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.Use
get_write_buffer_limits()
to get the limits.
-
write(data)
-
Write some data bytes to the transport.
This method does not block; it buffers the data and arranges for it to be sent out asynchronously.
-
writelines(list_of_data)
-
Write a list (or any iterable) of data bytes to the transport. This is functionally equivalent to calling
write()
on each element yielded by the iterable, but may be implemented more efficiently.
-
write_eof()
-
Close the write end of the transport after flushing buffered data. Data may still be received.
This method can raise
NotImplementedError
if the transport (e.g. SSL) doesn’t support half-closes.
Please login to continue.