Add pause/resume_writing, discard_output.

This commit is contained in:
Guido van Rossum 2013-05-22 13:22:52 -07:00
parent 8acf02f633
commit 51d8e64d24
1 changed files with 10 additions and 0 deletions

View File

@ -1019,6 +1019,16 @@ Bidirectional stream transports have the following public methods:
- ``resume()``. Restart delivery of data to the protocol via - ``resume()``. Restart delivery of data to the protocol via
``data_received()``. ``data_received()``.
- ``pause_writing()``. Suspend sending data to the network until a
subsequent ``resume_writing()`` call. Between ``pause_writing()``
and ``resume_writing()`` the transport's ``write()`` method will
just be accumulating data in an internal buffer.
- ``resume_writing()``. Restart sending data to the network.
- ``discard_output()``. Discard all data buffered by ``write()`` but
not yet sent to the network.
- ``close()``. Sever the connection with the entity at the other end. - ``close()``. Sever the connection with the entity at the other end.
Any data buffered by ``write()`` will (eventually) be transferred Any data buffered by ``write()`` will (eventually) be transferred
before the connection is actually closed. The protocol's before the connection is actually closed. The protocol's