mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Issue #21454: Fix asyncio.BaseEventLoop.connect_read_pipe doc
The function sets the the pipe to non-blocking mode.
This commit is contained in:
parent
28d0ae48e9
commit
a5b257af22
2 changed files with 6 additions and 6 deletions
|
@ -455,11 +455,11 @@ Connect pipes
|
||||||
|
|
||||||
.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
|
.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
|
||||||
|
|
||||||
Register read pipe in eventloop.
|
Register read pipe in eventloop. Set the *pipe* to non-blocking mode.
|
||||||
|
|
||||||
*protocol_factory* should instantiate object with :class:`Protocol`
|
*protocol_factory* should instantiate object with :class:`Protocol`
|
||||||
interface. pipe is file-like object already switched to nonblocking.
|
interface. *pipe* is a :term:`file-like object <file object>`.
|
||||||
Return pair (transport, protocol), where transport support
|
Return pair ``(transport, protocol)``, where *transport* supports the
|
||||||
:class:`ReadTransport` interface.
|
:class:`ReadTransport` interface.
|
||||||
|
|
||||||
This method is a :ref:`coroutine <coroutine>`.
|
This method is a :ref:`coroutine <coroutine>`.
|
||||||
|
|
|
@ -257,11 +257,11 @@ class AbstractEventLoop:
|
||||||
# Pipes and subprocesses.
|
# Pipes and subprocesses.
|
||||||
|
|
||||||
def connect_read_pipe(self, protocol_factory, pipe):
|
def connect_read_pipe(self, protocol_factory, pipe):
|
||||||
"""Register read pipe in event loop.
|
"""Register read pipe in event loop. Set the pipe to non-blocking mode.
|
||||||
|
|
||||||
protocol_factory should instantiate object with Protocol interface.
|
protocol_factory should instantiate object with Protocol interface.
|
||||||
pipe is file-like object already switched to nonblocking.
|
pipe is a file-like object.
|
||||||
Return pair (transport, protocol), where transport support
|
Return pair (transport, protocol), where transport supports the
|
||||||
ReadTransport interface."""
|
ReadTransport interface."""
|
||||||
# The reason to accept file-like object instead of just file descriptor
|
# The reason to accept file-like object instead of just file descriptor
|
||||||
# is: we need to own pipe and close it at transport finishing
|
# is: we need to own pipe and close it at transport finishing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue