mirror of https://github.com/python/cpython
asyncio doc: move stream classes to their own class
This commit is contained in:
parent
3eb45d3eae
commit
7235c05085
|
@ -1,8 +1,8 @@
|
|||
.. currentmodule:: asyncio
|
||||
|
||||
++++++++++++++++++++++++
|
||||
Transports and protocols
|
||||
++++++++++++++++++++++++
|
||||
+++++++++++++++++++++++++++++++++
|
||||
Transports, streams and protocols
|
||||
+++++++++++++++++++++++++++++++++
|
||||
|
||||
.. _transport:
|
||||
|
||||
|
@ -228,6 +228,53 @@ BaseSubprocessTransport
|
|||
stop the subprocess.
|
||||
|
||||
|
||||
Streams
|
||||
=======
|
||||
|
||||
StreamReader
|
||||
------------
|
||||
|
||||
.. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None)
|
||||
|
||||
.. method:: exception()
|
||||
|
||||
Get the exception.
|
||||
|
||||
.. method:: feed_eof()
|
||||
|
||||
XXX
|
||||
|
||||
.. method:: feed_data(data)
|
||||
|
||||
XXX
|
||||
|
||||
.. method:: set_exception(exc)
|
||||
|
||||
Set the exception.
|
||||
|
||||
.. method:: set_transport(transport)
|
||||
|
||||
Set the transport.
|
||||
|
||||
.. method:: read(n=-1)
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
|
||||
.. method:: readline()
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
|
||||
.. method:: readexactly(n)
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
|
||||
|
||||
StreamWriter
|
||||
------------
|
||||
|
||||
|
@ -291,48 +338,46 @@ StreamWriter
|
|||
see :meth:`WriteTransport.write_eof`.
|
||||
|
||||
|
||||
StreamReader
|
||||
------------
|
||||
StreamReaderProtocol
|
||||
--------------------
|
||||
|
||||
.. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None)
|
||||
.. class:: StreamReaderProtocol(stream_reader, client_connected_cb=None, loop=None)
|
||||
|
||||
.. method:: exception()
|
||||
Trivial helper class to adapt between :class:`Protocol` and
|
||||
:class:`StreamReader`. Sublclass of :class:`Protocol`.
|
||||
|
||||
Get the exception.
|
||||
*stream_reader* is a :class:`StreamReader` instance, *client_connected_cb*
|
||||
is an optional function called with (stream_reader, stream_writer) when a
|
||||
connection is made, *loop* is the event loop instance to use.
|
||||
|
||||
.. method:: feed_eof()
|
||||
(This is a helper class instead of making :class:`StreamReader` itself a
|
||||
:class:`Protocol` subclass, because the :class:`StreamReader` has other
|
||||
potential uses, and to prevent the user of the :class:`StreamReader` to
|
||||
accidentally call inappropriate methods of the protocol.)
|
||||
|
||||
.. method:: connection_made(transport)
|
||||
|
||||
XXX
|
||||
|
||||
.. method:: feed_data(data)
|
||||
.. method:: connection_lost(exc)
|
||||
|
||||
XXX
|
||||
|
||||
.. method:: set_exception(exc)
|
||||
|
||||
Set the exception.
|
||||
|
||||
.. method:: set_transport(transport)
|
||||
|
||||
Set the transport.
|
||||
|
||||
.. method:: read(n=-1)
|
||||
.. method:: data_received(data)
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
|
||||
.. method:: readline()
|
||||
.. method:: eof_received()
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
|
||||
.. method:: readexactly(n)
|
||||
.. method:: pause_writing()
|
||||
|
||||
XXX
|
||||
|
||||
This method returns a :ref:`coroutine object <coroutine>`.
|
||||
.. method:: resume_writing()
|
||||
|
||||
XXX
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue