bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914)

This commit is contained in:
Yury Selivanov 2017-12-18 17:03:23 -05:00 committed by GitHub
parent 2d8f06382e
commit d757aaf9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 87 additions and 24 deletions

View file

@ -118,17 +118,31 @@ ReadTransport
Interface for read-only transports.
.. method:: is_reading()
Return ``True`` if the transport is receiving new data.
.. versionadded:: 3.7
.. method:: pause_reading()
Pause the receiving end of the transport. No data will be passed to
the protocol's :meth:`data_received` method until :meth:`resume_reading`
is called.
.. versionchanged:: 3.7
The method is idempotent, i.e. it can be called when the
transport is already paused or closed.
.. method:: resume_reading()
Resume the receiving end. The protocol's :meth:`data_received` method
will be called once again if some data is available for reading.
.. versionchanged:: 3.7
The method is idempotent, i.e. it can be called when the
transport is already reading.
WriteTransport
--------------