Skip to content

Commit 5cc583d

Browse files
kbumsik1st1
authored andcommitted
bpo-33649: Clarify protocol_factory as a method parameter (GH-9330)
1 parent 7843cae commit 5cc583d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

Doc/library/asyncio-eventloop.rst

+17-4
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ Creating network servers
535535

536536
Arguments:
537537

538+
* *protocol_factory* must be a callable returning a
539+
:ref:`protocol <asyncio-protocol>` implementation.
540+
538541
* The *host* parameter can be set to several types which determine behavior:
539542
- If *host* is a string, the TCP server is bound to *host* and *port*.
540543
- if *host* is a sequence of strings, the TCP server is bound to all
@@ -617,6 +620,9 @@ Creating network servers
617620
:class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths
618621
are supported.
619622

623+
See the documentation of the :meth:`loop.create_server` method
624+
for information about arguments to this method.
625+
620626
Availability: UNIX.
621627

622628
.. versionadded:: 3.7
@@ -637,6 +643,9 @@ Creating network servers
637643

638644
Parameters:
639645

646+
* *protocol_factory* must be a callable returning a
647+
:ref:`protocol <asyncio-protocol>` implementation.
648+
640649
* *sock* is a preexisting socket object returned from
641650
:meth:`socket.accept <socket.socket.accept>`.
642651

@@ -909,7 +918,8 @@ Working with pipes
909918
*pipe* is a :term:`file-like object <file object>`.
910919

911920
Return pair ``(transport, protocol)``, where *transport* supports
912-
the :class:`ReadTransport` interface.
921+
the :class:`ReadTransport` interface and *protocol* is an object
922+
instantiated by the *protocol_factory*.
913923

914924
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
915925
non-blocking mode.
@@ -924,7 +934,8 @@ Working with pipes
924934
*pipe* is :term:`file-like object <file object>`.
925935

926936
Return pair ``(transport, protocol)``, where *transport* supports
927-
:class:`WriteTransport` interface.
937+
:class:`WriteTransport` interface and *protocol* is an object
938+
instantiated by the *protocol_factory*.
928939

929940
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
930941
non-blocking mode.
@@ -1159,7 +1170,8 @@ async/await code consider using high-level convenient
11591170
for documentation on other arguments.
11601171

11611172
Returns a pair of ``(transport, protocol)``, where *transport*
1162-
conforms to the :class:`asyncio.SubprocessTransport` base class.
1173+
conforms to the :class:`asyncio.SubprocessTransport` base class and
1174+
*protocol* is an object instantiated by the *protocol_factory*.
11631175

11641176
.. coroutinemethod:: loop.subprocess_shell(protocol_factory, cmd, \*, \
11651177
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
@@ -1180,7 +1192,8 @@ async/await code consider using high-level convenient
11801192
the remaining arguments.
11811193

11821194
Returns a pair of ``(transport, protocol)``, where *transport*
1183-
conforms to the :class:`SubprocessTransport` base class.
1195+
conforms to the :class:`SubprocessTransport` base class and
1196+
*protocol* is an object instantiated by the *protocol_factory*.
11841197

11851198
.. note::
11861199
It is the application's responsibility to ensure that all whitespace

0 commit comments

Comments
 (0)