@@ -162,7 +162,8 @@ Running and stopping the loop
162
162
This method is idempotent and irreversible. No other methods
163
163
should be called after the event loop is closed.
164
164
165
- .. coroutinemethod :: loop.shutdown_asyncgens()
165
+ .. method :: loop.shutdown_asyncgens()
166
+ :async:
166
167
167
168
Schedule all currently open :term: `asynchronous generator ` objects to
168
169
close with an :meth: `~agen.aclose ` call. After calling this method,
@@ -183,7 +184,8 @@ Running and stopping the loop
183
184
184
185
.. versionadded :: 3.6
185
186
186
- .. coroutinemethod :: loop.shutdown_default_executor(timeout=None)
187
+ .. method :: loop.shutdown_default_executor(timeout=None)
188
+ :async:
187
189
188
190
Schedule the closure of the default executor and wait for it to join all of
189
191
the threads in the :class: `~concurrent.futures.ThreadPoolExecutor `.
@@ -394,14 +396,15 @@ Creating Futures and Tasks
394
396
Opening network connections
395
397
^^^^^^^^^^^^^^^^^^^^^^^^^^^
396
398
397
- .. coroutinemethod :: loop.create_connection(protocol_factory, \
398
- host=None, port=None, *, ssl=None, \
399
- family=0, proto=0, flags=0, sock=None, \
400
- local_addr=None, server_hostname=None, \
401
- ssl_handshake_timeout=None, \
402
- ssl_shutdown_timeout=None, \
403
- happy_eyeballs_delay=None, interleave=None, \
404
- all_errors=False)
399
+ .. method :: loop.create_connection(protocol_factory, \
400
+ host=None, port=None, *, ssl=None, \
401
+ family=0, proto=0, flags=0, sock=None, \
402
+ local_addr=None, server_hostname=None, \
403
+ ssl_handshake_timeout=None, \
404
+ ssl_shutdown_timeout=None, \
405
+ happy_eyeballs_delay=None, interleave=None, \
406
+ all_errors=False)
407
+ :async:
405
408
406
409
Open a streaming transport connection to a given
407
410
address specified by *host * and *port *.
@@ -547,11 +550,12 @@ Opening network connections
547
550
API. It returns a pair of (:class: `StreamReader `, :class: `StreamWriter `)
548
551
that can be used directly in async/await code.
549
552
550
- .. coroutinemethod :: loop.create_datagram_endpoint(protocol_factory, \
551
- local_addr=None, remote_addr=None, *, \
552
- family=0, proto=0, flags=0, \
553
- reuse_port=None, \
554
- allow_broadcast=None, sock=None)
553
+ .. method :: loop.create_datagram_endpoint(protocol_factory, \
554
+ local_addr=None, remote_addr=None, *, \
555
+ family=0, proto=0, flags=0, \
556
+ reuse_port=None, \
557
+ allow_broadcast=None, sock=None)
558
+ :async:
555
559
556
560
Create a datagram connection.
557
561
@@ -632,10 +636,11 @@ Opening network connections
632
636
The *reuse_address * parameter, disabled since Python 3.8.1,
633
637
3.7.6 and 3.6.10, has been entirely removed.
634
638
635
- .. coroutinemethod :: loop.create_unix_connection(protocol_factory, \
636
- path=None, *, ssl=None, sock=None, \
637
- server_hostname=None, ssl_handshake_timeout=None, \
638
- ssl_shutdown_timeout=None)
639
+ .. method :: loop.create_unix_connection(protocol_factory, \
640
+ path=None, *, ssl=None, sock=None, \
641
+ server_hostname=None, ssl_handshake_timeout=None, \
642
+ ssl_shutdown_timeout=None)
643
+ :async:
639
644
640
645
Create a Unix connection.
641
646
@@ -668,16 +673,17 @@ Creating network servers
668
673
669
674
.. _loop_create_server :
670
675
671
- .. coroutinemethod :: loop.create_server(protocol_factory, \
672
- host=None, port=None, *, \
673
- family=socket.AF_UNSPEC, \
674
- flags=socket.AI_PASSIVE, \
675
- sock=None, backlog=100, ssl=None, \
676
- reuse_address=None, reuse_port=None, \
677
- keep_alive=None, \
678
- ssl_handshake_timeout=None, \
679
- ssl_shutdown_timeout=None, \
680
- start_serving=True)
676
+ .. method :: loop.create_server(protocol_factory, \
677
+ host=None, port=None, *, \
678
+ family=socket.AF_UNSPEC, \
679
+ flags=socket.AI_PASSIVE, \
680
+ sock=None, backlog=100, ssl=None, \
681
+ reuse_address=None, reuse_port=None, \
682
+ keep_alive=None, \
683
+ ssl_handshake_timeout=None, \
684
+ ssl_shutdown_timeout=None, \
685
+ start_serving=True)
686
+ :async:
681
687
682
688
Create a TCP server (socket type :const: `~socket.SOCK_STREAM `) listening
683
689
on *port * of the *host * address.
@@ -785,11 +791,12 @@ Creating network servers
785
791
that can be used in an async/await code.
786
792
787
793
788
- .. coroutinemethod :: loop.create_unix_server(protocol_factory, path=None, \
789
- *, sock=None, backlog=100, ssl=None, \
790
- ssl_handshake_timeout=None, \
791
- ssl_shutdown_timeout=None, \
792
- start_serving=True, cleanup_socket=True)
794
+ .. method :: loop.create_unix_server(protocol_factory, path=None, \
795
+ *, sock=None, backlog=100, ssl=None, \
796
+ ssl_handshake_timeout=None, \
797
+ ssl_shutdown_timeout=None, \
798
+ start_serving=True, cleanup_socket=True)
799
+ :async:
793
800
794
801
Similar to :meth: `loop.create_server ` but works with the
795
802
:py:const: `~socket.AF_UNIX ` socket family.
@@ -822,9 +829,10 @@ Creating network servers
822
829
Added the *cleanup_socket * parameter.
823
830
824
831
825
- .. coroutinemethod :: loop.connect_accepted_socket(protocol_factory, \
826
- sock, *, ssl=None, ssl_handshake_timeout=None, \
827
- ssl_shutdown_timeout=None)
832
+ .. method :: loop.connect_accepted_socket(protocol_factory, \
833
+ sock, *, ssl=None, ssl_handshake_timeout=None, \
834
+ ssl_shutdown_timeout=None)
835
+ :async:
828
836
829
837
Wrap an already accepted connection into a transport/protocol pair.
830
838
@@ -872,8 +880,9 @@ Creating network servers
872
880
Transferring files
873
881
^^^^^^^^^^^^^^^^^^
874
882
875
- .. coroutinemethod :: loop.sendfile(transport, file, \
876
- offset=0, count=None, *, fallback=True)
883
+ .. method :: loop.sendfile(transport, file, \
884
+ offset=0, count=None, *, fallback=True)
885
+ :async:
877
886
878
887
Send a *file * over a *transport *. Return the total number of bytes
879
888
sent.
@@ -902,10 +911,11 @@ Transferring files
902
911
TLS Upgrade
903
912
^^^^^^^^^^^
904
913
905
- .. coroutinemethod :: loop.start_tls(transport, protocol, \
906
- sslcontext, *, server_side=False, \
907
- server_hostname=None, ssl_handshake_timeout=None, \
908
- ssl_shutdown_timeout=None)
914
+ .. method :: loop.start_tls(transport, protocol, \
915
+ sslcontext, *, server_side=False, \
916
+ server_hostname=None, ssl_handshake_timeout=None, \
917
+ ssl_shutdown_timeout=None)
918
+ :async:
909
919
910
920
Upgrade an existing transport-based connection to TLS.
911
921
@@ -999,7 +1009,8 @@ However, there are some use cases when performance is not critical, and
999
1009
working with :class: `~socket.socket ` objects directly is more
1000
1010
convenient.
1001
1011
1002
- .. coroutinemethod :: loop.sock_recv(sock, nbytes)
1012
+ .. method :: loop.sock_recv(sock, nbytes)
1013
+ :async:
1003
1014
1004
1015
Receive up to *nbytes * from *sock *. Asynchronous version of
1005
1016
:meth: `socket.recv() <socket.socket.recv> `.
@@ -1013,7 +1024,8 @@ convenient.
1013
1024
method, releases before Python 3.7 returned a :class: `Future `.
1014
1025
Since Python 3.7 this is an ``async def `` method.
1015
1026
1016
- .. coroutinemethod :: loop.sock_recv_into(sock, buf)
1027
+ .. method :: loop.sock_recv_into(sock, buf)
1028
+ :async:
1017
1029
1018
1030
Receive data from *sock * into the *buf * buffer. Modeled after the blocking
1019
1031
:meth: `socket.recv_into() <socket.socket.recv_into> ` method.
@@ -1024,7 +1036,8 @@ convenient.
1024
1036
1025
1037
.. versionadded :: 3.7
1026
1038
1027
- .. coroutinemethod :: loop.sock_recvfrom(sock, bufsize)
1039
+ .. method :: loop.sock_recvfrom(sock, bufsize)
1040
+ :async:
1028
1041
1029
1042
Receive a datagram of up to *bufsize * from *sock *. Asynchronous version of
1030
1043
:meth: `socket.recvfrom() <socket.socket.recvfrom> `.
@@ -1035,7 +1048,8 @@ convenient.
1035
1048
1036
1049
.. versionadded :: 3.11
1037
1050
1038
- .. coroutinemethod :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1051
+ .. method :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1052
+ :async:
1039
1053
1040
1054
Receive a datagram of up to *nbytes * from *sock * into *buf *.
1041
1055
Asynchronous version of
@@ -1047,7 +1061,8 @@ convenient.
1047
1061
1048
1062
.. versionadded :: 3.11
1049
1063
1050
- .. coroutinemethod :: loop.sock_sendall(sock, data)
1064
+ .. method :: loop.sock_sendall(sock, data)
1065
+ :async:
1051
1066
1052
1067
Send *data * to the *sock * socket. Asynchronous version of
1053
1068
:meth: `socket.sendall() <socket.socket.sendall> `.
@@ -1065,7 +1080,8 @@ convenient.
1065
1080
method, before Python 3.7 it returned a :class: `Future `.
1066
1081
Since Python 3.7, this is an ``async def `` method.
1067
1082
1068
- .. coroutinemethod :: loop.sock_sendto(sock, data, address)
1083
+ .. method :: loop.sock_sendto(sock, data, address)
1084
+ :async:
1069
1085
1070
1086
Send a datagram from *sock * to *address *.
1071
1087
Asynchronous version of
@@ -1077,7 +1093,8 @@ convenient.
1077
1093
1078
1094
.. versionadded :: 3.11
1079
1095
1080
- .. coroutinemethod :: loop.sock_connect(sock, address)
1096
+ .. method :: loop.sock_connect(sock, address)
1097
+ :async:
1081
1098
1082
1099
Connect *sock * to a remote socket at *address *.
1083
1100
@@ -1098,7 +1115,8 @@ convenient.
1098
1115
and :func: `asyncio.open_connection() <open_connection> `.
1099
1116
1100
1117
1101
- .. coroutinemethod :: loop.sock_accept(sock)
1118
+ .. method :: loop.sock_accept(sock)
1119
+ :async:
1102
1120
1103
1121
Accept a connection. Modeled after the blocking
1104
1122
:meth: `socket.accept() <socket.socket.accept> ` method.
@@ -1120,8 +1138,9 @@ convenient.
1120
1138
1121
1139
:meth: `loop.create_server ` and :func: `start_server `.
1122
1140
1123
- .. coroutinemethod :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1124
- *, fallback=True)
1141
+ .. method :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1142
+ *, fallback=True)
1143
+ :async:
1125
1144
1126
1145
Send a file using high-performance :mod: `os.sendfile ` if possible.
1127
1146
Return the total number of bytes sent.
@@ -1155,12 +1174,14 @@ convenient.
1155
1174
DNS
1156
1175
^^^
1157
1176
1158
- .. coroutinemethod :: loop.getaddrinfo(host, port, *, family=0, \
1159
- type=0, proto=0, flags=0)
1177
+ .. method :: loop.getaddrinfo(host, port, *, family=0, \
1178
+ type=0, proto=0, flags=0)
1179
+ :async:
1160
1180
1161
1181
Asynchronous version of :meth: `socket.getaddrinfo `.
1162
1182
1163
- .. coroutinemethod :: loop.getnameinfo(sockaddr, flags=0)
1183
+ .. method :: loop.getnameinfo(sockaddr, flags=0)
1184
+ :async:
1164
1185
1165
1186
Asynchronous version of :meth: `socket.getnameinfo `.
1166
1187
@@ -1182,7 +1203,8 @@ DNS
1182
1203
Working with pipes
1183
1204
^^^^^^^^^^^^^^^^^^
1184
1205
1185
- .. coroutinemethod :: loop.connect_read_pipe(protocol_factory, pipe)
1206
+ .. method :: loop.connect_read_pipe(protocol_factory, pipe)
1207
+ :async:
1186
1208
1187
1209
Register the read end of *pipe * in the event loop.
1188
1210
@@ -1198,7 +1220,8 @@ Working with pipes
1198
1220
With :class: `SelectorEventLoop ` event loop, the *pipe * is set to
1199
1221
non-blocking mode.
1200
1222
1201
- .. coroutinemethod :: loop.connect_write_pipe(protocol_factory, pipe)
1223
+ .. method :: loop.connect_write_pipe(protocol_factory, pipe)
1224
+ :async:
1202
1225
1203
1226
Register the write end of *pipe * in the event loop.
1204
1227
@@ -1463,9 +1486,10 @@ async/await code consider using the high-level
1463
1486
1464
1487
.. _loop_subprocess_exec :
1465
1488
1466
- .. coroutinemethod :: loop.subprocess_exec(protocol_factory, *args, \
1467
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1468
- stderr=subprocess.PIPE, **kwargs)
1489
+ .. method :: loop.subprocess_exec(protocol_factory, *args, \
1490
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1491
+ stderr=subprocess.PIPE, **kwargs)
1492
+ :async:
1469
1493
1470
1494
Create a subprocess from one or more string arguments specified by
1471
1495
*args *.
@@ -1545,9 +1569,10 @@ async/await code consider using the high-level
1545
1569
conforms to the :class: `asyncio.SubprocessTransport ` base class and
1546
1570
*protocol * is an object instantiated by the *protocol_factory *.
1547
1571
1548
- .. coroutinemethod :: loop.subprocess_shell(protocol_factory, cmd, *, \
1549
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1550
- stderr=subprocess.PIPE, **kwargs)
1572
+ .. method :: loop.subprocess_shell(protocol_factory, cmd, *, \
1573
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1574
+ stderr=subprocess.PIPE, **kwargs)
1575
+ :async:
1551
1576
1552
1577
Create a subprocess from *cmd *, which can be a :class: `str ` or a
1553
1578
:class: `bytes ` string encoded to the
@@ -1692,7 +1717,8 @@ Do not instantiate the :class:`Server` class directly.
1692
1717
1693
1718
.. versionadded :: 3.7
1694
1719
1695
- .. coroutinemethod :: start_serving()
1720
+ .. method :: start_serving()
1721
+ :async:
1696
1722
1697
1723
Start accepting connections.
1698
1724
@@ -1708,7 +1734,8 @@ Do not instantiate the :class:`Server` class directly.
1708
1734
1709
1735
.. versionadded :: 3.7
1710
1736
1711
- .. coroutinemethod :: serve_forever()
1737
+ .. method :: serve_forever()
1738
+ :async:
1712
1739
1713
1740
Start accepting connections until the coroutine is cancelled.
1714
1741
Cancellation of ``serve_forever `` task causes the server
@@ -1740,7 +1767,8 @@ Do not instantiate the :class:`Server` class directly.
1740
1767
1741
1768
.. versionadded :: 3.7
1742
1769
1743
- .. coroutinemethod :: wait_closed()
1770
+ .. method :: wait_closed()
1771
+ :async:
1744
1772
1745
1773
Wait until the :meth: `close ` method completes and all active
1746
1774
connections have finished.
0 commit comments