summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fasyncio-llapi-index.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/library%2Fasyncio-llapi-index.html
new repository
Diffstat (limited to 'devdocs/python~3.12/library%2Fasyncio-llapi-index.html')
-rw-r--r--devdocs/python~3.12/library%2Fasyncio-llapi-index.html110
1 files changed, 110 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Fasyncio-llapi-index.html b/devdocs/python~3.12/library%2Fasyncio-llapi-index.html
new file mode 100644
index 00000000..0c6bb291
--- /dev/null
+++ b/devdocs/python~3.12/library%2Fasyncio-llapi-index.html
@@ -0,0 +1,110 @@
+ <h1>Low-level API Index</h1> <p>This page lists all low-level asyncio APIs.</p> <section id="obtaining-the-event-loop"> <h2>Obtaining the Event Loop</h2> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.get_running_loop" title="asyncio.get_running_loop"><code>asyncio.get_running_loop()</code></a></p></td> <td><p>The <strong>preferred</strong> function to get the running event loop.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.get_event_loop" title="asyncio.get_event_loop"><code>asyncio.get_event_loop()</code></a></p></td> <td><p>Get an event loop instance (running or current via the current policy).</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.set_event_loop" title="asyncio.set_event_loop"><code>asyncio.set_event_loop()</code></a></p></td> <td><p>Set the event loop as current via the current policy.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.new_event_loop" title="asyncio.new_event_loop"><code>asyncio.new_event_loop()</code></a></p></td> <td><p>Create a new event loop.</p></td> </tr> </table> <h4 class="rubric">Examples</h4> <ul class="simple"> <li>
+<a class="reference internal" href="asyncio-future#asyncio-example-future"><span class="std std-ref">Using asyncio.get_running_loop()</span></a>.</li> </ul> </section> <section id="event-loop-methods"> <h2>Event Loop Methods</h2> <p>See also the main documentation section about the <a class="reference internal" href="asyncio-eventloop#asyncio-event-loop-methods"><span class="std std-ref">Event Loop Methods</span></a>.</p> <h4 class="rubric">Lifecycle</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.run_until_complete" title="asyncio.loop.run_until_complete"><code>loop.run_until_complete()</code></a></p></td> <td><p>Run a Future/Task/awaitable until complete.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.run_forever" title="asyncio.loop.run_forever"><code>loop.run_forever()</code></a></p></td> <td><p>Run the event loop forever.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.stop" title="asyncio.loop.stop"><code>loop.stop()</code></a></p></td> <td><p>Stop the event loop.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.close" title="asyncio.loop.close"><code>loop.close()</code></a></p></td> <td><p>Close the event loop.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.is_running" title="asyncio.loop.is_running"><code>loop.is_running()</code></a></p></td> <td><p>Return <code>True</code> if the event loop is running.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.is_closed" title="asyncio.loop.is_closed"><code>loop.is_closed()</code></a></p></td> <td><p>Return <code>True</code> if the event loop is closed.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.shutdown_asyncgens" title="asyncio.loop.shutdown_asyncgens"><code>loop.shutdown_asyncgens()</code></a></p></td> <td><p>Close asynchronous generators.</p></td> </tr> </table> <h4 class="rubric">Debugging</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.set_debug" title="asyncio.loop.set_debug"><code>loop.set_debug()</code></a></p></td> <td><p>Enable or disable the debug mode.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.get_debug" title="asyncio.loop.get_debug"><code>loop.get_debug()</code></a></p></td> <td><p>Get the current debug mode.</p></td> </tr> </table> <h4 class="rubric">Scheduling Callbacks</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_soon" title="asyncio.loop.call_soon"><code>loop.call_soon()</code></a></p></td> <td><p>Invoke a callback soon.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_soon_threadsafe" title="asyncio.loop.call_soon_threadsafe"><code>loop.call_soon_threadsafe()</code></a></p></td> <td><p>A thread-safe variant of <a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_soon" title="asyncio.loop.call_soon"><code>loop.call_soon()</code></a>.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_later" title="asyncio.loop.call_later"><code>loop.call_later()</code></a></p></td> <td><p>Invoke a callback <em>after</em> the given time.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_at" title="asyncio.loop.call_at"><code>loop.call_at()</code></a></p></td> <td><p>Invoke a callback <em>at</em> the given time.</p></td> </tr> </table> <h4 class="rubric">Thread/Process Pool</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.run_in_executor" title="asyncio.loop.run_in_executor"><code>loop.run_in_executor()</code></a></p></td> <td><p>Run a CPU-bound or other blocking function in a <a class="reference internal" href="concurrent.futures#module-concurrent.futures" title="concurrent.futures: Execute computations concurrently using threads or processes."><code>concurrent.futures</code></a> executor.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.set_default_executor" title="asyncio.loop.set_default_executor"><code>loop.set_default_executor()</code></a></p></td> <td><p>Set the default executor for <a class="reference internal" href="asyncio-eventloop#asyncio.loop.run_in_executor" title="asyncio.loop.run_in_executor"><code>loop.run_in_executor()</code></a>.</p></td> </tr> </table> <h4 class="rubric">Tasks and Futures</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_future" title="asyncio.loop.create_future"><code>loop.create_future()</code></a></p></td> <td><p>Create a <a class="reference internal" href="asyncio-future#asyncio.Future" title="asyncio.Future"><code>Future</code></a> object.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_task" title="asyncio.loop.create_task"><code>loop.create_task()</code></a></p></td> <td><p>Schedule coroutine as a <a class="reference internal" href="asyncio-task#asyncio.Task" title="asyncio.Task"><code>Task</code></a>.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.set_task_factory" title="asyncio.loop.set_task_factory"><code>loop.set_task_factory()</code></a></p></td> <td><p>Set a factory used by <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_task" title="asyncio.loop.create_task"><code>loop.create_task()</code></a> to create <a class="reference internal" href="asyncio-task#asyncio.Task" title="asyncio.Task"><code>Tasks</code></a>.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.get_task_factory" title="asyncio.loop.get_task_factory"><code>loop.get_task_factory()</code></a></p></td> <td><p>Get the factory <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_task" title="asyncio.loop.create_task"><code>loop.create_task()</code></a> uses to create <a class="reference internal" href="asyncio-task#asyncio.Task" title="asyncio.Task"><code>Tasks</code></a>.</p></td> </tr> </table> <h4 class="rubric">DNS</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.getaddrinfo" title="asyncio.loop.getaddrinfo"><code>loop.getaddrinfo()</code></a></p></td> <td><p>Asynchronous version of <a class="reference internal" href="socket#socket.getaddrinfo" title="socket.getaddrinfo"><code>socket.getaddrinfo()</code></a>.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.getnameinfo" title="asyncio.loop.getnameinfo"><code>loop.getnameinfo()</code></a></p></td> <td><p>Asynchronous version of <a class="reference internal" href="socket#socket.getnameinfo" title="socket.getnameinfo"><code>socket.getnameinfo()</code></a>.</p></td> </tr> </table> <h4 class="rubric">Networking and IPC</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_connection" title="asyncio.loop.create_connection"><code>loop.create_connection()</code></a></p></td> <td><p>Open a TCP connection.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_server" title="asyncio.loop.create_server"><code>loop.create_server()</code></a></p></td> <td><p>Create a TCP server.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_unix_connection" title="asyncio.loop.create_unix_connection"><code>loop.create_unix_connection()</code></a></p></td> <td><p>Open a Unix socket connection.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_unix_server" title="asyncio.loop.create_unix_server"><code>loop.create_unix_server()</code></a></p></td> <td><p>Create a Unix socket server.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.connect_accepted_socket" title="asyncio.loop.connect_accepted_socket"><code>loop.connect_accepted_socket()</code></a></p></td> <td><p>Wrap a <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a> into a <code>(transport, protocol)</code> pair.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_datagram_endpoint" title="asyncio.loop.create_datagram_endpoint"><code>loop.create_datagram_endpoint()</code></a></p></td> <td><p>Open a datagram (UDP) connection.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sendfile" title="asyncio.loop.sendfile"><code>loop.sendfile()</code></a></p></td> <td><p>Send a file over a transport.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.start_tls" title="asyncio.loop.start_tls"><code>loop.start_tls()</code></a></p></td> <td><p>Upgrade an existing connection to TLS.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.connect_read_pipe" title="asyncio.loop.connect_read_pipe"><code>loop.connect_read_pipe()</code></a></p></td> <td><p>Wrap a read end of a pipe into a <code>(transport, protocol)</code> pair.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.connect_write_pipe" title="asyncio.loop.connect_write_pipe"><code>loop.connect_write_pipe()</code></a></p></td> <td><p>Wrap a write end of a pipe into a <code>(transport, protocol)</code> pair.</p></td> </tr> </table> <h4 class="rubric">Sockets</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_recv" title="asyncio.loop.sock_recv"><code>loop.sock_recv()</code></a></p></td> <td><p>Receive data from the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a>.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_recv_into" title="asyncio.loop.sock_recv_into"><code>loop.sock_recv_into()</code></a></p></td> <td><p>Receive data from the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a> into a buffer.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_recvfrom" title="asyncio.loop.sock_recvfrom"><code>loop.sock_recvfrom()</code></a></p></td> <td><p>Receive a datagram from the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a>.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_recvfrom_into" title="asyncio.loop.sock_recvfrom_into"><code>loop.sock_recvfrom_into()</code></a></p></td> <td><p>Receive a datagram from the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a> into a buffer.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_sendall" title="asyncio.loop.sock_sendall"><code>loop.sock_sendall()</code></a></p></td> <td><p>Send data to the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a>.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_sendto" title="asyncio.loop.sock_sendto"><code>loop.sock_sendto()</code></a></p></td> <td><p>Send a datagram via the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a> to the given address.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_connect" title="asyncio.loop.sock_connect"><code>loop.sock_connect()</code></a></p></td> <td><p>Connect the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a>.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_accept" title="asyncio.loop.sock_accept"><code>loop.sock_accept()</code></a></p></td> <td><p>Accept a <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a> connection.</p></td> </tr> <tr>
+<td><p><code>await</code> <a class="reference internal" href="asyncio-eventloop#asyncio.loop.sock_sendfile" title="asyncio.loop.sock_sendfile"><code>loop.sock_sendfile()</code></a></p></td> <td><p>Send a file over the <a class="reference internal" href="socket#socket.socket" title="socket.socket"><code>socket</code></a>.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.add_reader" title="asyncio.loop.add_reader"><code>loop.add_reader()</code></a></p></td> <td><p>Start watching a file descriptor for read availability.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.remove_reader" title="asyncio.loop.remove_reader"><code>loop.remove_reader()</code></a></p></td> <td><p>Stop watching a file descriptor for read availability.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.add_writer" title="asyncio.loop.add_writer"><code>loop.add_writer()</code></a></p></td> <td><p>Start watching a file descriptor for write availability.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.remove_writer" title="asyncio.loop.remove_writer"><code>loop.remove_writer()</code></a></p></td> <td><p>Stop watching a file descriptor for write availability.</p></td> </tr> </table> <h4 class="rubric">Unix Signals</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.add_signal_handler" title="asyncio.loop.add_signal_handler"><code>loop.add_signal_handler()</code></a></p></td> <td><p>Add a handler for a <a class="reference internal" href="signal#module-signal" title="signal: Set handlers for asynchronous events."><code>signal</code></a>.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.remove_signal_handler" title="asyncio.loop.remove_signal_handler"><code>loop.remove_signal_handler()</code></a></p></td> <td><p>Remove a handler for a <a class="reference internal" href="signal#module-signal" title="signal: Set handlers for asynchronous events."><code>signal</code></a>.</p></td> </tr> </table> <h4 class="rubric">Subprocesses</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.subprocess_exec" title="asyncio.loop.subprocess_exec"><code>loop.subprocess_exec()</code></a></p></td> <td><p>Spawn a subprocess.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.subprocess_shell" title="asyncio.loop.subprocess_shell"><code>loop.subprocess_shell()</code></a></p></td> <td><p>Spawn a subprocess from a shell command.</p></td> </tr> </table> <h4 class="rubric">Error Handling</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.call_exception_handler" title="asyncio.loop.call_exception_handler"><code>loop.call_exception_handler()</code></a></p></td> <td><p>Call the exception handler.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.set_exception_handler" title="asyncio.loop.set_exception_handler"><code>loop.set_exception_handler()</code></a></p></td> <td><p>Set a new exception handler.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.get_exception_handler" title="asyncio.loop.get_exception_handler"><code>loop.get_exception_handler()</code></a></p></td> <td><p>Get the current exception handler.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-eventloop#asyncio.loop.default_exception_handler" title="asyncio.loop.default_exception_handler"><code>loop.default_exception_handler()</code></a></p></td> <td><p>The default exception handler implementation.</p></td> </tr> </table> <h4 class="rubric">Examples</h4> <ul class="simple"> <li>
+<a class="reference internal" href="asyncio-eventloop#asyncio-example-lowlevel-helloworld"><span class="std std-ref">Using asyncio.new_event_loop() and loop.run_forever()</span></a>.</li> <li>
+<a class="reference internal" href="asyncio-eventloop#asyncio-example-call-later"><span class="std std-ref">Using loop.call_later()</span></a>.</li> <li>Using <code>loop.create_connection()</code> to implement <a class="reference internal" href="asyncio-protocol#asyncio-example-tcp-echo-client-protocol"><span class="std std-ref">an echo-client</span></a>.</li> <li>Using <code>loop.create_connection()</code> to <a class="reference internal" href="asyncio-protocol#asyncio-example-create-connection"><span class="std std-ref">connect a socket</span></a>.</li> <li>
+<a class="reference internal" href="asyncio-eventloop#asyncio-example-watch-fd"><span class="std std-ref">Using add_reader() to watch an FD for read events</span></a>.</li> <li>
+<a class="reference internal" href="asyncio-eventloop#asyncio-example-unix-signals"><span class="std std-ref">Using loop.add_signal_handler()</span></a>.</li> <li>
+<a class="reference internal" href="asyncio-protocol#asyncio-example-subprocess-proto"><span class="std std-ref">Using loop.subprocess_exec()</span></a>.</li> </ul> </section> <section id="transports"> <h2>Transports</h2> <p>All transports implement the following methods:</p> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.BaseTransport.close" title="asyncio.BaseTransport.close"><code>transport.close()</code></a></p></td> <td><p>Close the transport.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.BaseTransport.is_closing" title="asyncio.BaseTransport.is_closing"><code>transport.is_closing()</code></a></p></td> <td><p>Return <code>True</code> if the transport is closing or is closed.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.BaseTransport.get_extra_info" title="asyncio.BaseTransport.get_extra_info"><code>transport.get_extra_info()</code></a></p></td> <td><p>Request for information about the transport.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.BaseTransport.set_protocol" title="asyncio.BaseTransport.set_protocol"><code>transport.set_protocol()</code></a></p></td> <td><p>Set a new protocol.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.BaseTransport.get_protocol" title="asyncio.BaseTransport.get_protocol"><code>transport.get_protocol()</code></a></p></td> <td><p>Return the current protocol.</p></td> </tr> </table> <p>Transports that can receive data (TCP and Unix connections, pipes, etc). Returned from methods like <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_connection" title="asyncio.loop.create_connection"><code>loop.create_connection()</code></a>, <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_unix_connection" title="asyncio.loop.create_unix_connection"><code>loop.create_unix_connection()</code></a>, <a class="reference internal" href="asyncio-eventloop#asyncio.loop.connect_read_pipe" title="asyncio.loop.connect_read_pipe"><code>loop.connect_read_pipe()</code></a>, etc:</p> <h4 class="rubric">Read Transports</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.ReadTransport.is_reading" title="asyncio.ReadTransport.is_reading"><code>transport.is_reading()</code></a></p></td> <td><p>Return <code>True</code> if the transport is receiving.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.ReadTransport.pause_reading" title="asyncio.ReadTransport.pause_reading"><code>transport.pause_reading()</code></a></p></td> <td><p>Pause receiving.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.ReadTransport.resume_reading" title="asyncio.ReadTransport.resume_reading"><code>transport.resume_reading()</code></a></p></td> <td><p>Resume receiving.</p></td> </tr> </table> <p>Transports that can Send data (TCP and Unix connections, pipes, etc). Returned from methods like <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_connection" title="asyncio.loop.create_connection"><code>loop.create_connection()</code></a>, <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_unix_connection" title="asyncio.loop.create_unix_connection"><code>loop.create_unix_connection()</code></a>, <a class="reference internal" href="asyncio-eventloop#asyncio.loop.connect_write_pipe" title="asyncio.loop.connect_write_pipe"><code>loop.connect_write_pipe()</code></a>, etc:</p> <h4 class="rubric">Write Transports</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.write" title="asyncio.WriteTransport.write"><code>transport.write()</code></a></p></td> <td><p>Write data to the transport.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.writelines" title="asyncio.WriteTransport.writelines"><code>transport.writelines()</code></a></p></td> <td><p>Write buffers to the transport.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.can_write_eof" title="asyncio.WriteTransport.can_write_eof"><code>transport.can_write_eof()</code></a></p></td> <td><p>Return <a class="reference internal" href="constants#True" title="True"><code>True</code></a> if the transport supports sending EOF.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.write_eof" title="asyncio.WriteTransport.write_eof"><code>transport.write_eof()</code></a></p></td> <td><p>Close and send EOF after flushing buffered data.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.abort" title="asyncio.WriteTransport.abort"><code>transport.abort()</code></a></p></td> <td><p>Close the transport immediately.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.get_write_buffer_size" title="asyncio.WriteTransport.get_write_buffer_size"><code>transport.get_write_buffer_size()</code></a></p></td> <td><p>Return the current size of the output buffer.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.get_write_buffer_limits" title="asyncio.WriteTransport.get_write_buffer_limits"><code>transport.get_write_buffer_limits()</code></a></p></td> <td><p>Return high and low water marks for write flow control.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.WriteTransport.set_write_buffer_limits" title="asyncio.WriteTransport.set_write_buffer_limits"><code>transport.set_write_buffer_limits()</code></a></p></td> <td><p>Set new high and low water marks for write flow control.</p></td> </tr> </table> <p>Transports returned by <a class="reference internal" href="asyncio-eventloop#asyncio.loop.create_datagram_endpoint" title="asyncio.loop.create_datagram_endpoint"><code>loop.create_datagram_endpoint()</code></a>:</p> <h4 class="rubric">Datagram Transports</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.DatagramTransport.sendto" title="asyncio.DatagramTransport.sendto"><code>transport.sendto()</code></a></p></td> <td><p>Send data to the remote peer.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.DatagramTransport.abort" title="asyncio.DatagramTransport.abort"><code>transport.abort()</code></a></p></td> <td><p>Close the transport immediately.</p></td> </tr> </table> <p>Low-level transport abstraction over subprocesses. Returned by <a class="reference internal" href="asyncio-eventloop#asyncio.loop.subprocess_exec" title="asyncio.loop.subprocess_exec"><code>loop.subprocess_exec()</code></a> and <a class="reference internal" href="asyncio-eventloop#asyncio.loop.subprocess_shell" title="asyncio.loop.subprocess_shell"><code>loop.subprocess_shell()</code></a>:</p> <h4 class="rubric">Subprocess Transports</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.get_pid" title="asyncio.SubprocessTransport.get_pid"><code>transport.get_pid()</code></a></p></td> <td><p>Return the subprocess process id.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.get_pipe_transport" title="asyncio.SubprocessTransport.get_pipe_transport"><code>transport.get_pipe_transport()</code></a></p></td> <td><p>Return the transport for the requested communication pipe (<em>stdin</em>, <em>stdout</em>, or <em>stderr</em>).</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.get_returncode" title="asyncio.SubprocessTransport.get_returncode"><code>transport.get_returncode()</code></a></p></td> <td><p>Return the subprocess return code.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.kill" title="asyncio.SubprocessTransport.kill"><code>transport.kill()</code></a></p></td> <td><p>Kill the subprocess.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.send_signal" title="asyncio.SubprocessTransport.send_signal"><code>transport.send_signal()</code></a></p></td> <td><p>Send a signal to the subprocess.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.terminate" title="asyncio.SubprocessTransport.terminate"><code>transport.terminate()</code></a></p></td> <td><p>Stop the subprocess.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-protocol#asyncio.SubprocessTransport.close" title="asyncio.SubprocessTransport.close"><code>transport.close()</code></a></p></td> <td><p>Kill the subprocess and close all pipes.</p></td> </tr> </table> </section> <section id="protocols"> <h2>Protocols</h2> <p>Protocol classes can implement the following <strong>callback methods</strong>:</p> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BaseProtocol.connection_made" title="asyncio.BaseProtocol.connection_made"><code>connection_made()</code></a></p></td> <td><p>Called when a connection is made.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BaseProtocol.connection_lost" title="asyncio.BaseProtocol.connection_lost"><code>connection_lost()</code></a></p></td> <td><p>Called when the connection is lost or closed.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BaseProtocol.pause_writing" title="asyncio.BaseProtocol.pause_writing"><code>pause_writing()</code></a></p></td> <td><p>Called when the transport’s buffer goes over the high water mark.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BaseProtocol.resume_writing" title="asyncio.BaseProtocol.resume_writing"><code>resume_writing()</code></a></p></td> <td><p>Called when the transport’s buffer drains below the low water mark.</p></td> </tr> </table> <h4 class="rubric">Streaming Protocols (TCP, Unix Sockets, Pipes)</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.Protocol.data_received" title="asyncio.Protocol.data_received"><code>data_received()</code></a></p></td> <td><p>Called when some data is received.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.Protocol.eof_received" title="asyncio.Protocol.eof_received"><code>eof_received()</code></a></p></td> <td><p>Called when an EOF is received.</p></td> </tr> </table> <h4 class="rubric">Buffered Streaming Protocols</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BufferedProtocol.get_buffer" title="asyncio.BufferedProtocol.get_buffer"><code>get_buffer()</code></a></p></td> <td><p>Called to allocate a new receive buffer.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BufferedProtocol.buffer_updated" title="asyncio.BufferedProtocol.buffer_updated"><code>buffer_updated()</code></a></p></td> <td><p>Called when the buffer was updated with the received data.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.BufferedProtocol.eof_received" title="asyncio.BufferedProtocol.eof_received"><code>eof_received()</code></a></p></td> <td><p>Called when an EOF is received.</p></td> </tr> </table> <h4 class="rubric">Datagram Protocols</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.DatagramProtocol.datagram_received" title="asyncio.DatagramProtocol.datagram_received"><code>datagram_received()</code></a></p></td> <td><p>Called when a datagram is received.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.DatagramProtocol.error_received" title="asyncio.DatagramProtocol.error_received"><code>error_received()</code></a></p></td> <td><p>Called when a previous send or receive operation raises an <a class="reference internal" href="exceptions#OSError" title="OSError"><code>OSError</code></a>.</p></td> </tr> </table> <h4 class="rubric">Subprocess Protocols</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.SubprocessProtocol.pipe_data_received" title="asyncio.SubprocessProtocol.pipe_data_received"><code>pipe_data_received()</code></a></p></td> <td><p>Called when the child process writes data into its <em>stdout</em> or <em>stderr</em> pipe.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.SubprocessProtocol.pipe_connection_lost" title="asyncio.SubprocessProtocol.pipe_connection_lost"><code>pipe_connection_lost()</code></a></p></td> <td><p>Called when one of the pipes communicating with the child process is closed.</p></td> </tr> <tr>
+<td><p><code>callback</code> <a class="reference internal" href="asyncio-protocol#asyncio.SubprocessProtocol.process_exited" title="asyncio.SubprocessProtocol.process_exited"><code>process_exited()</code></a></p></td> <td><p>Called when the child process has exited. It can be called before <a class="reference internal" href="asyncio-protocol#asyncio.SubprocessProtocol.pipe_data_received" title="asyncio.SubprocessProtocol.pipe_data_received"><code>pipe_data_received()</code></a> and <a class="reference internal" href="asyncio-protocol#asyncio.SubprocessProtocol.pipe_connection_lost" title="asyncio.SubprocessProtocol.pipe_connection_lost"><code>pipe_connection_lost()</code></a> methods.</p></td> </tr> </table> </section> <section id="event-loop-policies"> <h2>Event Loop Policies</h2> <p>Policies is a low-level mechanism to alter the behavior of functions like <a class="reference internal" href="asyncio-eventloop#asyncio.get_event_loop" title="asyncio.get_event_loop"><code>asyncio.get_event_loop()</code></a>. See also the main <a class="reference internal" href="asyncio-policy#asyncio-policies"><span class="std std-ref">policies section</span></a> for more details.</p> <h4 class="rubric">Accessing Policies</h4> <table class="colwidths-given full-width-table docutils align-default"> <tr>
+<td><p><a class="reference internal" href="asyncio-policy#asyncio.get_event_loop_policy" title="asyncio.get_event_loop_policy"><code>asyncio.get_event_loop_policy()</code></a></p></td> <td><p>Return the current process-wide policy.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-policy#asyncio.set_event_loop_policy" title="asyncio.set_event_loop_policy"><code>asyncio.set_event_loop_policy()</code></a></p></td> <td><p>Set a new process-wide policy.</p></td> </tr> <tr>
+<td><p><a class="reference internal" href="asyncio-policy#asyncio.AbstractEventLoopPolicy" title="asyncio.AbstractEventLoopPolicy"><code>AbstractEventLoopPolicy</code></a></p></td> <td><p>Base class for policy objects.</p></td> </tr> </table> </section> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/library/asyncio-llapi-index.html" class="_attribution-link">https://docs.python.org/3.12/library/asyncio-llapi-index.html</a>
+ </p>
+</div>