@@ -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,7 +673,7 @@ Creating network servers
668
673
669
674
.. _loop_create_server :
670
675
671
- .. coroutinemethod :: loop.create_server(protocol_factory, \
676
+ .. method :: loop.create_server(protocol_factory, \
672
677
host=None, port=None, *, \
673
678
family=socket.AF_UNSPEC, \
674
679
flags=socket.AI_PASSIVE, \
@@ -677,6 +682,7 @@ Creating network servers
677
682
ssl_handshake_timeout=None, \
678
683
ssl_shutdown_timeout=None, \
679
684
start_serving=True)
685
+ :async:
680
686
681
687
Create a TCP server (socket type :const: `~socket.SOCK_STREAM `) listening
682
688
on *port * of the *host * address.
@@ -777,11 +783,12 @@ Creating network servers
777
783
that can be used in an async/await code.
778
784
779
785
780
- .. coroutinemethod :: loop.create_unix_server(protocol_factory, path=None, \
781
- *, sock=None, backlog=100, ssl=None, \
782
- ssl_handshake_timeout=None, \
783
- ssl_shutdown_timeout=None, \
784
- start_serving=True)
786
+ .. method :: loop.create_unix_server(protocol_factory, path=None, \
787
+ *, sock=None, backlog=100, ssl=None, \
788
+ ssl_handshake_timeout=None, \
789
+ ssl_shutdown_timeout=None, \
790
+ start_serving=True)
791
+ :async:
785
792
786
793
Similar to :meth: `loop.create_server ` but works with the
787
794
:py:const: `~socket.AF_UNIX ` socket family.
@@ -806,9 +813,10 @@ Creating network servers
806
813
Added the *ssl_shutdown_timeout * parameter.
807
814
808
815
809
- .. coroutinemethod :: loop.connect_accepted_socket(protocol_factory, \
810
- sock, *, ssl=None, ssl_handshake_timeout=None, \
811
- ssl_shutdown_timeout=None)
816
+ .. method :: loop.connect_accepted_socket(protocol_factory, \
817
+ sock, *, ssl=None, ssl_handshake_timeout=None, \
818
+ ssl_shutdown_timeout=None)
819
+ :async:
812
820
813
821
Wrap an already accepted connection into a transport/protocol pair.
814
822
@@ -856,8 +864,9 @@ Creating network servers
856
864
Transferring files
857
865
^^^^^^^^^^^^^^^^^^
858
866
859
- .. coroutinemethod :: loop.sendfile(transport, file, \
860
- offset=0, count=None, *, fallback=True)
867
+ .. method :: loop.sendfile(transport, file, \
868
+ offset=0, count=None, *, fallback=True)
869
+ :async:
861
870
862
871
Send a *file * over a *transport *. Return the total number of bytes
863
872
sent.
@@ -886,10 +895,11 @@ Transferring files
886
895
TLS Upgrade
887
896
^^^^^^^^^^^
888
897
889
- .. coroutinemethod :: loop.start_tls(transport, protocol, \
890
- sslcontext, *, server_side=False, \
891
- server_hostname=None, ssl_handshake_timeout=None, \
892
- ssl_shutdown_timeout=None)
898
+ .. method :: loop.start_tls(transport, protocol, \
899
+ sslcontext, *, server_side=False, \
900
+ server_hostname=None, ssl_handshake_timeout=None, \
901
+ ssl_shutdown_timeout=None)
902
+ :async:
893
903
894
904
Upgrade an existing transport-based connection to TLS.
895
905
@@ -983,7 +993,8 @@ However, there are some use cases when performance is not critical, and
983
993
working with :class: `~socket.socket ` objects directly is more
984
994
convenient.
985
995
986
- .. coroutinemethod :: loop.sock_recv(sock, nbytes)
996
+ .. method :: loop.sock_recv(sock, nbytes)
997
+ :async:
987
998
988
999
Receive up to *nbytes * from *sock *. Asynchronous version of
989
1000
:meth: `socket.recv() <socket.socket.recv> `.
@@ -997,7 +1008,8 @@ convenient.
997
1008
method, releases before Python 3.7 returned a :class: `Future `.
998
1009
Since Python 3.7 this is an ``async def `` method.
999
1010
1000
- .. coroutinemethod :: loop.sock_recv_into(sock, buf)
1011
+ .. method :: loop.sock_recv_into(sock, buf)
1012
+ :async:
1001
1013
1002
1014
Receive data from *sock * into the *buf * buffer. Modeled after the blocking
1003
1015
:meth: `socket.recv_into() <socket.socket.recv_into> ` method.
@@ -1008,7 +1020,8 @@ convenient.
1008
1020
1009
1021
.. versionadded :: 3.7
1010
1022
1011
- .. coroutinemethod :: loop.sock_recvfrom(sock, bufsize)
1023
+ .. method :: loop.sock_recvfrom(sock, bufsize)
1024
+ :async:
1012
1025
1013
1026
Receive a datagram of up to *bufsize * from *sock *. Asynchronous version of
1014
1027
:meth: `socket.recvfrom() <socket.socket.recvfrom> `.
@@ -1019,7 +1032,8 @@ convenient.
1019
1032
1020
1033
.. versionadded :: 3.11
1021
1034
1022
- .. coroutinemethod :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1035
+ .. method :: loop.sock_recvfrom_into(sock, buf, nbytes=0)
1036
+ :async:
1023
1037
1024
1038
Receive a datagram of up to *nbytes * from *sock * into *buf *.
1025
1039
Asynchronous version of
@@ -1031,7 +1045,8 @@ convenient.
1031
1045
1032
1046
.. versionadded :: 3.11
1033
1047
1034
- .. coroutinemethod :: loop.sock_sendall(sock, data)
1048
+ .. method :: loop.sock_sendall(sock, data)
1049
+ :async:
1035
1050
1036
1051
Send *data * to the *sock * socket. Asynchronous version of
1037
1052
:meth: `socket.sendall() <socket.socket.sendall> `.
@@ -1049,7 +1064,8 @@ convenient.
1049
1064
method, before Python 3.7 it returned a :class: `Future `.
1050
1065
Since Python 3.7, this is an ``async def `` method.
1051
1066
1052
- .. coroutinemethod :: loop.sock_sendto(sock, data, address)
1067
+ .. method :: loop.sock_sendto(sock, data, address)
1068
+ :async:
1053
1069
1054
1070
Send a datagram from *sock * to *address *.
1055
1071
Asynchronous version of
@@ -1061,7 +1077,8 @@ convenient.
1061
1077
1062
1078
.. versionadded :: 3.11
1063
1079
1064
- .. coroutinemethod :: loop.sock_connect(sock, address)
1080
+ .. method :: loop.sock_connect(sock, address)
1081
+ :async:
1065
1082
1066
1083
Connect *sock * to a remote socket at *address *.
1067
1084
@@ -1082,7 +1099,8 @@ convenient.
1082
1099
and :func: `asyncio.open_connection() <open_connection> `.
1083
1100
1084
1101
1085
- .. coroutinemethod :: loop.sock_accept(sock)
1102
+ .. method :: loop.sock_accept(sock)
1103
+ :async:
1086
1104
1087
1105
Accept a connection. Modeled after the blocking
1088
1106
:meth: `socket.accept() <socket.socket.accept> ` method.
@@ -1104,8 +1122,9 @@ convenient.
1104
1122
1105
1123
:meth: `loop.create_server ` and :func: `start_server `.
1106
1124
1107
- .. coroutinemethod :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1108
- *, fallback=True)
1125
+ .. method :: loop.sock_sendfile(sock, file, offset=0, count=None, \
1126
+ *, fallback=True)
1127
+ :async:
1109
1128
1110
1129
Send a file using high-performance :mod: `os.sendfile ` if possible.
1111
1130
Return the total number of bytes sent.
@@ -1139,12 +1158,14 @@ convenient.
1139
1158
DNS
1140
1159
^^^
1141
1160
1142
- .. coroutinemethod :: loop.getaddrinfo(host, port, *, family=0, \
1143
- type=0, proto=0, flags=0)
1161
+ .. method :: loop.getaddrinfo(host, port, *, family=0, \
1162
+ type=0, proto=0, flags=0)
1163
+ :async:
1144
1164
1145
1165
Asynchronous version of :meth: `socket.getaddrinfo `.
1146
1166
1147
- .. coroutinemethod :: loop.getnameinfo(sockaddr, flags=0)
1167
+ .. method :: loop.getnameinfo(sockaddr, flags=0)
1168
+ :async:
1148
1169
1149
1170
Asynchronous version of :meth: `socket.getnameinfo `.
1150
1171
@@ -1166,7 +1187,8 @@ DNS
1166
1187
Working with pipes
1167
1188
^^^^^^^^^^^^^^^^^^
1168
1189
1169
- .. coroutinemethod :: loop.connect_read_pipe(protocol_factory, pipe)
1190
+ .. method :: loop.connect_read_pipe(protocol_factory, pipe)
1191
+ :async:
1170
1192
1171
1193
Register the read end of *pipe * in the event loop.
1172
1194
@@ -1182,7 +1204,8 @@ Working with pipes
1182
1204
With :class: `SelectorEventLoop ` event loop, the *pipe * is set to
1183
1205
non-blocking mode.
1184
1206
1185
- .. coroutinemethod :: loop.connect_write_pipe(protocol_factory, pipe)
1207
+ .. method :: loop.connect_write_pipe(protocol_factory, pipe)
1208
+ :async:
1186
1209
1187
1210
Register the write end of *pipe * in the event loop.
1188
1211
@@ -1447,9 +1470,10 @@ async/await code consider using the high-level
1447
1470
1448
1471
.. _loop_subprocess_exec :
1449
1472
1450
- .. coroutinemethod :: loop.subprocess_exec(protocol_factory, *args, \
1451
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1452
- stderr=subprocess.PIPE, **kwargs)
1473
+ .. method :: loop.subprocess_exec(protocol_factory, *args, \
1474
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1475
+ stderr=subprocess.PIPE, **kwargs)
1476
+ :async:
1453
1477
1454
1478
Create a subprocess from one or more string arguments specified by
1455
1479
*args *.
@@ -1529,9 +1553,10 @@ async/await code consider using the high-level
1529
1553
conforms to the :class: `asyncio.SubprocessTransport ` base class and
1530
1554
*protocol * is an object instantiated by the *protocol_factory *.
1531
1555
1532
- .. coroutinemethod :: loop.subprocess_shell(protocol_factory, cmd, *, \
1533
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1534
- stderr=subprocess.PIPE, **kwargs)
1556
+ .. method :: loop.subprocess_shell(protocol_factory, cmd, *, \
1557
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1558
+ stderr=subprocess.PIPE, **kwargs)
1559
+ :async:
1535
1560
1536
1561
Create a subprocess from *cmd *, which can be a :class: `str ` or a
1537
1562
:class: `bytes ` string encoded to the
@@ -1651,7 +1676,8 @@ Do not instantiate the :class:`Server` class directly.
1651
1676
1652
1677
.. versionadded :: 3.7
1653
1678
1654
- .. coroutinemethod :: start_serving()
1679
+ .. method :: start_serving()
1680
+ :async:
1655
1681
1656
1682
Start accepting connections.
1657
1683
@@ -1667,7 +1693,8 @@ Do not instantiate the :class:`Server` class directly.
1667
1693
1668
1694
.. versionadded :: 3.7
1669
1695
1670
- .. coroutinemethod :: serve_forever()
1696
+ .. method :: serve_forever()
1697
+ :async:
1671
1698
1672
1699
Start accepting connections until the coroutine is cancelled.
1673
1700
Cancellation of ``serve_forever `` task causes the server
@@ -1699,7 +1726,8 @@ Do not instantiate the :class:`Server` class directly.
1699
1726
1700
1727
.. versionadded :: 3.7
1701
1728
1702
- .. coroutinemethod :: wait_closed()
1729
+ .. method :: wait_closed()
1730
+ :async:
1703
1731
1704
1732
Wait until the :meth: `close ` method completes and all active
1705
1733
connections have finished.
0 commit comments