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