@@ -172,7 +172,8 @@ Running and stopping the loop
172
172
This method is idempotent and irreversible. No other methods
173
173
should be called after the event loop is closed.
174
174
175
- .. coroutinemethod :: loop.shutdown_asyncgens()
175
+ .. method :: loop.shutdown_asyncgens()
176
+ :async:
176
177
177
178
Schedule all currently open :term: `asynchronous generator ` objects to
178
179
close with an :meth: `~agen.aclose ` call. After calling this method,
@@ -193,7 +194,8 @@ Running and stopping the loop
193
194
194
195
.. versionadded :: 3.6
195
196
196
- .. coroutinemethod :: loop.shutdown_default_executor(timeout=None)
197
+ .. method :: loop.shutdown_default_executor(timeout=None)
198
+ :async:
197
199
198
200
Schedule the closure of the default executor and wait for it to join all of
199
201
the threads in the :class: `~concurrent.futures.ThreadPoolExecutor `.
@@ -404,14 +406,15 @@ Creating Futures and Tasks
404
406
Opening network connections
405
407
^^^^^^^^^^^^^^^^^^^^^^^^^^^
406
408
407
- .. coroutinemethod :: loop.create_connection(protocol_factory, \
408
- host=None, port=None, *, ssl=None, \
409
- family=0, proto=0, flags=0, sock=None, \
410
- local_addr=None, server_hostname=None, \
411
- ssl_handshake_timeout=None, \
412
- ssl_shutdown_timeout=None, \
413
- happy_eyeballs_delay=None, interleave=None, \
414
- all_errors=False)
409
+ .. method :: loop.create_connection(protocol_factory, \
410
+ host=None, port=None, *, ssl=None, \
411
+ family=0, proto=0, flags=0, sock=None, \
412
+ local_addr=None, server_hostname=None, \
413
+ ssl_handshake_timeout=None, \
414
+ ssl_shutdown_timeout=None, \
415
+ happy_eyeballs_delay=None, interleave=None, \
416
+ all_errors=False)
417
+ :async:
415
418
416
419
Open a streaming transport connection to a given
417
420
address specified by *host * and *port *.
@@ -557,11 +560,12 @@ Opening network connections
557
560
API. It returns a pair of (:class: `StreamReader `, :class: `StreamWriter `)
558
561
that can be used directly in async/await code.
559
562
560
- .. coroutinemethod :: loop.create_datagram_endpoint(protocol_factory, \
561
- local_addr=None, remote_addr=None, *, \
562
- family=0, proto=0, flags=0, \
563
- reuse_port=None, \
564
- allow_broadcast=None, sock=None)
563
+ .. method :: loop.create_datagram_endpoint(protocol_factory, \
564
+ local_addr=None, remote_addr=None, *, \
565
+ family=0, proto=0, flags=0, \
566
+ reuse_port=None, \
567
+ allow_broadcast=None, sock=None)
568
+ :async:
565
569
566
570
Create a datagram connection.
567
571
@@ -642,10 +646,11 @@ Opening network connections
642
646
The *reuse_address * parameter, disabled since Python 3.8.1,
643
647
3.7.6 and 3.6.10, has been entirely removed.
644
648
645
- .. coroutinemethod :: loop.create_unix_connection(protocol_factory, \
646
- path=None, *, ssl=None, sock=None, \
647
- server_hostname=None, ssl_handshake_timeout=None, \
648
- ssl_shutdown_timeout=None)
649
+ .. method :: loop.create_unix_connection(protocol_factory, \
650
+ path=None, *, ssl=None, sock=None, \
651
+ server_hostname=None, ssl_handshake_timeout=None, \
652
+ ssl_shutdown_timeout=None)
653
+ :async:
649
654
650
655
Create a Unix connection.
651
656
@@ -678,16 +683,17 @@ Creating network servers
678
683
679
684
.. _loop_create_server :
680
685
681
- .. coroutinemethod :: loop.create_server(protocol_factory, \
682
- host=None, port=None, *, \
683
- family=socket.AF_UNSPEC, \
684
- flags=socket.AI_PASSIVE, \
685
- sock=None, backlog=100, ssl=None, \
686
- reuse_address=None, reuse_port=None, \
687
- keep_alive=None, \
688
- ssl_handshake_timeout=None, \
689
- ssl_shutdown_timeout=None, \
690
- start_serving=True)
686
+ .. method :: loop.create_server(protocol_factory, \
687
+ host=None, port=None, *, \
688
+ family=socket.AF_UNSPEC, \
689
+ flags=socket.AI_PASSIVE, \
690
+ sock=None, backlog=100, ssl=None, \
691
+ reuse_address=None, reuse_port=None, \
692
+ keep_alive=None, \
693
+ ssl_handshake_timeout=None, \
694
+ ssl_shutdown_timeout=None, \
695
+ start_serving=True)
696
+ :async:
691
697
692
698
Create a TCP server (socket type :const: `~socket.SOCK_STREAM `) listening
693
699
on *port * of the *host * address.
@@ -795,11 +801,12 @@ Creating network servers
795
801
that can be used in an async/await code.
796
802
797
803
798
- .. coroutinemethod :: loop.create_unix_server(protocol_factory, path=None, \
799
- *, sock=None, backlog=100, ssl=None, \
800
- ssl_handshake_timeout=None, \
801
- ssl_shutdown_timeout=None, \
802
- start_serving=True, cleanup_socket=True)
804
+ .. method :: loop.create_unix_server(protocol_factory, path=None, \
805
+ *, sock=None, backlog=100, ssl=None, \
806
+ ssl_handshake_timeout=None, \
807
+ ssl_shutdown_timeout=None, \
808
+ start_serving=True, cleanup_socket=True)
809
+ :async:
803
810
804
811
Similar to :meth: `loop.create_server ` but works with the
805
812
:py:const: `~socket.AF_UNIX ` socket family.
@@ -832,9 +839,10 @@ Creating network servers
832
839
Added the *cleanup_socket * parameter.
833
840
834
841
835
- .. coroutinemethod :: loop.connect_accepted_socket(protocol_factory, \
836
- sock, *, ssl=None, ssl_handshake_timeout=None, \
837
- ssl_shutdown_timeout=None)
842
+ .. method :: loop.connect_accepted_socket(protocol_factory, \
843
+ sock, *, ssl=None, ssl_handshake_timeout=None, \
844
+ ssl_shutdown_timeout=None)
845
+ :async:
838
846
839
847
Wrap an already accepted connection into a transport/protocol pair.
840
848
@@ -882,8 +890,9 @@ Creating network servers
882
890
Transferring files
883
891
^^^^^^^^^^^^^^^^^^
884
892
885
- .. coroutinemethod :: loop.sendfile(transport, file, \
886
- offset=0, count=None, *, fallback=True)
893
+ .. method :: loop.sendfile(transport, file, \
894
+ offset=0, count=None, *, fallback=True)
895
+ :async:
887
896
888
897
Send a *file * over a *transport *. Return the total number of bytes
889
898
sent.
@@ -912,10 +921,11 @@ Transferring files
912
921
TLS Upgrade
913
922
^^^^^^^^^^^
914
923
915
- .. coroutinemethod :: loop.start_tls(transport, protocol, \
916
- sslcontext, *, server_side=False, \
917
- server_hostname=None, ssl_handshake_timeout=None, \
918
- ssl_shutdown_timeout=None)
924
+ .. method :: loop.start_tls(transport, protocol, \
925
+ sslcontext, *, server_side=False, \
926
+ server_hostname=None, ssl_handshake_timeout=None, \
927
+ ssl_shutdown_timeout=None)
928
+ :async:
919
929
920
930
Upgrade an existing transport-based connection to TLS.
921
931
@@ -1009,7 +1019,8 @@ However, there are some use cases when performance is not critical, and
1009
1019
working with :class: `~socket.socket ` objects directly is more
1010
1020
convenient.
1011
1021
1012
- .. coroutinemethod :: loop.sock_recv(sock, nbytes)
1022
+ .. method :: loop.sock_recv(sock, nbytes)
1023
+ :async:
1013
1024
1014
1025
Receive up to *nbytes * from *sock *. Asynchronous version of
1015
1026
:meth: `socket.recv() <socket.socket.recv> `.
@@ -1023,7 +1034,8 @@ convenient.
1023
1034
method, releases before Python 3.7 returned a :class: `Future `.
1024
1035
Since Python 3.7 this is an ``async def `` method.
1025
1036
1026
- .. coroutinemethod :: loop.sock_recv_into(sock, buf)
1037
+ .. method :: loop.sock_recv_into(sock, buf)
1038
+ :async:
1027
1039
1028
1040
Receive data from *sock * into the *buf * buffer. Modeled after the blocking
1029
1041
:meth: `socket.recv_into() <socket.socket.recv_into> ` method.
@@ -1034,7 +1046,8 @@ convenient.
1034
1046
1035
1047
.. versionadded :: 3.7
1036
1048
1037
- .. coroutinemethod :: loop.sock_recvfrom(sock, bufsize)
1049
+ .. method :: loop.sock_recvfrom(sock, bufsize)
1050
+ :async:
1038
1051
1039
1052
Receive a datagram of up to *bufsize * from *sock *. Asynchronous version of
1040
1053
:meth: `socket.recvfrom() <socket.socket.recvfrom> `.
@@ -1045,7 +1058,8 @@ convenient.
1045
1058
1046
1059
.. versionadded :: 3.11
1047
1060
1048
- .. coroutinemethod :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1061
+ .. method :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1062
+ :async:
1049
1063
1050
1064
Receive a datagram of up to *nbytes * from *sock * into *buf *.
1051
1065
Asynchronous version of
@@ -1057,7 +1071,8 @@ convenient.
1057
1071
1058
1072
.. versionadded :: 3.11
1059
1073
1060
- .. coroutinemethod :: loop.sock_sendall(sock, data)
1074
+ .. method :: loop.sock_sendall(sock, data)
1075
+ :async:
1061
1076
1062
1077
Send *data * to the *sock * socket. Asynchronous version of
1063
1078
:meth: `socket.sendall() <socket.socket.sendall> `.
@@ -1075,7 +1090,8 @@ convenient.
1075
1090
method, before Python 3.7 it returned a :class: `Future `.
1076
1091
Since Python 3.7, this is an ``async def `` method.
1077
1092
1078
- .. coroutinemethod :: loop.sock_sendto(sock, data, address)
1093
+ .. method :: loop.sock_sendto(sock, data, address)
1094
+ :async:
1079
1095
1080
1096
Send a datagram from *sock * to *address *.
1081
1097
Asynchronous version of
@@ -1087,7 +1103,8 @@ convenient.
1087
1103
1088
1104
.. versionadded :: 3.11
1089
1105
1090
- .. coroutinemethod :: loop.sock_connect(sock, address)
1106
+ .. method :: loop.sock_connect(sock, address)
1107
+ :async:
1091
1108
1092
1109
Connect *sock * to a remote socket at *address *.
1093
1110
@@ -1108,7 +1125,8 @@ convenient.
1108
1125
and :func: `asyncio.open_connection() <open_connection> `.
1109
1126
1110
1127
1111
- .. coroutinemethod :: loop.sock_accept(sock)
1128
+ .. method :: loop.sock_accept(sock)
1129
+ :async:
1112
1130
1113
1131
Accept a connection. Modeled after the blocking
1114
1132
:meth: `socket.accept() <socket.socket.accept> ` method.
@@ -1130,8 +1148,9 @@ convenient.
1130
1148
1131
1149
:meth: `loop.create_server ` and :func: `start_server `.
1132
1150
1133
- .. coroutinemethod :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1134
- *, fallback=True)
1151
+ .. method :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1152
+ *, fallback=True)
1153
+ :async:
1135
1154
1136
1155
Send a file using high-performance :mod: `os.sendfile ` if possible.
1137
1156
Return the total number of bytes sent.
@@ -1165,12 +1184,14 @@ convenient.
1165
1184
DNS
1166
1185
^^^
1167
1186
1168
- .. coroutinemethod :: loop.getaddrinfo(host, port, *, family=0, \
1169
- type=0, proto=0, flags=0)
1187
+ .. method :: loop.getaddrinfo(host, port, *, family=0, \
1188
+ type=0, proto=0, flags=0)
1189
+ :async:
1170
1190
1171
1191
Asynchronous version of :meth: `socket.getaddrinfo `.
1172
1192
1173
- .. coroutinemethod :: loop.getnameinfo(sockaddr, flags=0)
1193
+ .. method :: loop.getnameinfo(sockaddr, flags=0)
1194
+ :async:
1174
1195
1175
1196
Asynchronous version of :meth: `socket.getnameinfo `.
1176
1197
@@ -1192,7 +1213,8 @@ DNS
1192
1213
Working with pipes
1193
1214
^^^^^^^^^^^^^^^^^^
1194
1215
1195
- .. coroutinemethod :: loop.connect_read_pipe(protocol_factory, pipe)
1216
+ .. method :: loop.connect_read_pipe(protocol_factory, pipe)
1217
+ :async:
1196
1218
1197
1219
Register the read end of *pipe * in the event loop.
1198
1220
@@ -1208,7 +1230,8 @@ Working with pipes
1208
1230
With :class: `SelectorEventLoop ` event loop, the *pipe * is set to
1209
1231
non-blocking mode.
1210
1232
1211
- .. coroutinemethod :: loop.connect_write_pipe(protocol_factory, pipe)
1233
+ .. method :: loop.connect_write_pipe(protocol_factory, pipe)
1234
+ :async:
1212
1235
1213
1236
Register the write end of *pipe * in the event loop.
1214
1237
@@ -1480,9 +1503,10 @@ async/await code consider using the high-level
1480
1503
1481
1504
.. _loop_subprocess_exec :
1482
1505
1483
- .. coroutinemethod :: loop.subprocess_exec(protocol_factory, *args, \
1484
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1485
- stderr=subprocess.PIPE, **kwargs)
1506
+ .. method :: loop.subprocess_exec(protocol_factory, *args, \
1507
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1508
+ stderr=subprocess.PIPE, **kwargs)
1509
+ :async:
1486
1510
1487
1511
Create a subprocess from one or more string arguments specified by
1488
1512
*args *.
@@ -1562,9 +1586,10 @@ async/await code consider using the high-level
1562
1586
conforms to the :class: `asyncio.SubprocessTransport ` base class and
1563
1587
*protocol * is an object instantiated by the *protocol_factory *.
1564
1588
1565
- .. coroutinemethod :: loop.subprocess_shell(protocol_factory, cmd, *, \
1566
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1567
- stderr=subprocess.PIPE, **kwargs)
1589
+ .. method :: loop.subprocess_shell(protocol_factory, cmd, *, \
1590
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1591
+ stderr=subprocess.PIPE, **kwargs)
1592
+ :async:
1568
1593
1569
1594
Create a subprocess from *cmd *, which can be a :class: `str ` or a
1570
1595
:class: `bytes ` string encoded to the
@@ -1709,7 +1734,8 @@ Do not instantiate the :class:`Server` class directly.
1709
1734
1710
1735
.. versionadded :: 3.7
1711
1736
1712
- .. coroutinemethod :: start_serving()
1737
+ .. method :: start_serving()
1738
+ :async:
1713
1739
1714
1740
Start accepting connections.
1715
1741
@@ -1725,7 +1751,8 @@ Do not instantiate the :class:`Server` class directly.
1725
1751
1726
1752
.. versionadded :: 3.7
1727
1753
1728
- .. coroutinemethod :: serve_forever()
1754
+ .. method :: serve_forever()
1755
+ :async:
1729
1756
1730
1757
Start accepting connections until the coroutine is cancelled.
1731
1758
Cancellation of ``serve_forever `` task causes the server
@@ -1757,7 +1784,8 @@ Do not instantiate the :class:`Server` class directly.
1757
1784
1758
1785
.. versionadded :: 3.7
1759
1786
1760
- .. coroutinemethod :: wait_closed()
1787
+ .. method :: wait_closed()
1788
+ :async:
1761
1789
1762
1790
Wait until the :meth: `close ` method completes and all active
1763
1791
connections have finished.
0 commit comments