@@ -22,6 +22,8 @@ It provides multiple facilities, amongst which:
2222
2323 Base class of event loops.
2424
25+ This class is :ref: `not thread safe <asyncio-multithreading >`.
26+
2527Run an event loop
2628-----------------
2729
@@ -104,6 +106,9 @@ keywords to your callback, use :func:`functools.partial`. For example,
104106
105107 Like :meth: `call_soon `, but thread safe.
106108
109+ See the :ref: `concurrency and multithreading <asyncio-multithreading >`
110+ section of the documentation.
111+
107112
108113.. _asyncio-delayed-calls :
109114
@@ -180,7 +185,7 @@ Coroutines
180185Creating connections
181186--------------------
182187
183- .. method :: BaseEventLoop.create_connection(protocol_factory, host=None, port=None, \*, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None)
188+ .. coroutinemethod :: BaseEventLoop.create_connection(protocol_factory, host=None, port=None, \*, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None)
184189
185190 Create a streaming transport connection to a given Internet *host * and
186191 *port *: socket family :py:data: `~socket.AF_INET ` or
@@ -253,7 +258,7 @@ Creating connections
253258 (:class: `StreamReader `, :class: `StreamWriter `) instead of a protocol.
254259
255260
256- .. method :: BaseEventLoop.create_datagram_endpoint(protocol_factory, local_addr=None, remote_addr=None, \*, family=0, proto=0, flags=0)
261+ .. coroutinemethod :: BaseEventLoop.create_datagram_endpoint(protocol_factory, local_addr=None, remote_addr=None, \*, family=0, proto=0, flags=0)
257262
258263 Create datagram connection: socket family :py:data: `~socket.AF_INET ` or
259264 :py:data: `~socket.AF_INET6 ` depending on *host * (or *family * if specified),
@@ -271,7 +276,7 @@ Creating connections
271276 :ref: `UDP echo server protocol <asyncio-udp-echo-server-protocol >` examples.
272277
273278
274- .. method :: BaseEventLoop.create_unix_connection(protocol_factory, path, \*, ssl=None, sock=None, server_hostname=None)
279+ .. coroutinemethod :: BaseEventLoop.create_unix_connection(protocol_factory, path, \*, ssl=None, sock=None, server_hostname=None)
275280
276281 Create UNIX connection: socket family :py:data: `~socket.AF_UNIX `, socket
277282 type :py:data: `~socket.SOCK_STREAM `. The :py:data: `~socket.AF_UNIX ` socket
@@ -290,7 +295,7 @@ Creating connections
290295Creating listening connections
291296------------------------------
292297
293- .. method :: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None)
298+ .. coroutinemethod :: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None)
294299
295300 Create a TCP server (socket type :data: `~socket.SOCK_STREAM `) bound to
296301 *host * and *port *.
@@ -336,11 +341,13 @@ Creating listening connections
336341 :class: `StreamWriter `) pair and calls back a function with this pair.
337342
338343
339- .. method :: BaseEventLoop.create_unix_server(protocol_factory, path=None, \*, sock=None, backlog=100, ssl=None)
344+ .. coroutinemethod :: BaseEventLoop.create_unix_server(protocol_factory, path=None, \*, sock=None, backlog=100, ssl=None)
340345
341346 Similar to :meth: `BaseEventLoop.create_server `, but specific to the
342347 socket family :py:data: `~socket.AF_UNIX `.
343348
349+ This method is a :ref: `coroutine <coroutine >`.
350+
344351 Availability: UNIX.
345352
346353
@@ -384,7 +391,7 @@ the file descriptor of a socket.
384391Low-level socket operations
385392---------------------------
386393
387- .. method :: BaseEventLoop.sock_recv(sock, nbytes)
394+ .. coroutinemethod :: BaseEventLoop.sock_recv(sock, nbytes)
388395
389396 Receive data from the socket. The return value is a bytes object
390397 representing the data received. The maximum amount of data to be received
@@ -399,7 +406,7 @@ Low-level socket operations
399406
400407 The :meth: `socket.socket.recv ` method.
401408
402- .. method :: BaseEventLoop.sock_sendall(sock, data)
409+ .. coroutinemethod :: BaseEventLoop.sock_sendall(sock, data)
403410
404411 Send data to the socket. The socket must be connected to a remote socket.
405412 This method continues to send data from *data * until either all data has
@@ -416,7 +423,7 @@ Low-level socket operations
416423
417424 The :meth: `socket.socket.sendall ` method.
418425
419- .. method :: BaseEventLoop.sock_connect(sock, address)
426+ .. coroutinemethod :: BaseEventLoop.sock_connect(sock, address)
420427
421428 Connect to a remote socket at *address *.
422429
@@ -438,7 +445,7 @@ Low-level socket operations
438445 method.
439446
440447
441- .. method :: BaseEventLoop.sock_accept(sock)
448+ .. coroutinemethod :: BaseEventLoop.sock_accept(sock)
442449
443450 Accept a connection. The socket must be bound to an address and listening
444451 for connections. The return value is a pair ``(conn, address) `` where *conn *
@@ -459,12 +466,12 @@ Low-level socket operations
459466Resolve host name
460467-----------------
461468
462- .. method :: BaseEventLoop.getaddrinfo(host, port, \*, family=0, type=0, proto=0, flags=0)
469+ .. coroutinemethod :: BaseEventLoop.getaddrinfo(host, port, \*, family=0, type=0, proto=0, flags=0)
463470
464471 This method is a :ref: `coroutine <coroutine >`, similar to
465472 :meth: `socket.getaddrinfo ` function but non-blocking.
466473
467- .. method :: BaseEventLoop.getnameinfo(sockaddr, flags=0)
474+ .. coroutinemethod :: BaseEventLoop.getnameinfo(sockaddr, flags=0)
468475
469476 This method is a :ref: `coroutine <coroutine >`, similar to
470477 :meth: `socket.getnameinfo ` function but non-blocking.
@@ -476,7 +483,7 @@ Connect pipes
476483On Windows with :class: `SelectorEventLoop `, these methods are not supported.
477484Use :class: `ProactorEventLoop ` to support pipes on Windows.
478485
479- .. method :: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
486+ .. coroutinemethod :: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
480487
481488 Register read pipe in eventloop.
482489
@@ -490,7 +497,7 @@ Use :class:`ProactorEventLoop` to support pipes on Windows.
490497
491498 This method is a :ref: `coroutine <coroutine >`.
492499
493- .. method :: BaseEventLoop.connect_write_pipe(protocol_factory, pipe)
500+ .. coroutinemethod :: BaseEventLoop.connect_write_pipe(protocol_factory, pipe)
494501
495502 Register write pipe in eventloop.
496503
@@ -543,7 +550,7 @@ Call a function in an :class:`~concurrent.futures.Executor` (pool of threads or
543550pool of processes). By default, an event loop uses a thread pool executor
544551(:class: `~concurrent.futures.ThreadPoolExecutor `).
545552
546- .. method :: BaseEventLoop.run_in_executor(executor, callback, \*args)
553+ .. coroutinemethod :: BaseEventLoop.run_in_executor(executor, callback, \*args)
547554
548555 Arrange for a callback to be called in the specified executor.
549556
@@ -654,7 +661,7 @@ Server
654661 The server is closed asynchonously, use the :meth: `wait_closed ` coroutine
655662 to wait until the server is closed.
656663
657- .. method :: wait_closed()
664+ .. coroutinemethod :: wait_closed()
658665
659666 Wait until the :meth: `close ` method completes.
660667
0 commit comments