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