@@ -22,9 +22,11 @@ replacing the host loop, asyncio piggybacks on it:
2222 When I/O events arrive it hands them back to the host thread via a
2323 thread-safe callback. The thread is not a daemon thread; it is joined
2424 when the guest run finishes.
25- * The host thread then runs :meth: `~asyncio.BaseEventLoop.process_events `
26- and :meth: `~asyncio.BaseEventLoop.process_ready ` to advance the asyncio
27- event loop by one step, then signals the I/O thread to poll again.
25+ * The host thread then runs
26+ :meth: `loop.process_events() <asyncio.loop.process_events> ` and
27+ :meth: `loop.process_ready() <asyncio.loop.process_ready> ` to advance
28+ the asyncio event loop by one step, then signals the I/O thread to
29+ poll again.
2830
2931Exactly one of the two threads touches the event loop at any moment, so
3032neither the host loop nor the asyncio loop starves the other.
@@ -74,7 +76,7 @@ example that embeds asyncio inside ``tkinter.mainloop()`` using
7476 This wakes the I/O thread from its selector wait so cancellation is
7577 processed promptly.
7678
77- .. versionadded :: 3.15
79+ .. versionadded :: 3.16
7880
7981.. _asyncio-guest-lifecycle :
8082
@@ -128,40 +130,10 @@ Host Requirements
128130
129131.. rubric :: Low-level Event Loop Methods
130132
131- The following three methods on :class: `BaseEventLoop ` are used internally by
132- :func: `start_guest_run `. They decompose :meth: `~BaseEventLoop._run_once `
133- into independently callable steps and are documented here for completeness.
134-
135- .. method :: loop.poll_events()
136-
137- Poll for I/O events without processing them.
138-
139- Cleans up cancelled scheduled handles, computes an appropriate timeout
140- from the scheduled callbacks, and calls the underlying selector. Returns
141- the raw event list.
142-
143- Together with :meth: `~BaseEventLoop.process_events ` and
144- :meth: `~BaseEventLoop.process_ready `, this method decomposes
145- :meth: `~BaseEventLoop._run_once ` into independently callable steps so that
146- an external event loop can drive asyncio (see :func: `start_guest_run `).
147-
148- .. versionadded :: 3.15
149-
150- .. method :: loop.process_events(event_list)
151-
152- Process I/O events returned by :meth: `~BaseEventLoop.poll_events `.
153-
154- Delegates to the selector-specific ``_process_events `` implementation
155- which turns raw selector events into ready callbacks.
156-
157- .. versionadded :: 3.15
158-
159- .. method :: loop.process_ready()
160-
161- Process expired timers and execute ready callbacks.
162-
163- Moves scheduled callbacks whose deadline has passed into the ready queue,
164- then runs all callbacks that were ready at call time. Callbacks enqueued
165- *by * running callbacks are left for the next iteration.
166-
167- .. versionadded :: 3.15
133+ :func: `start_guest_run ` drives the loop through three low-level methods
134+ -- :meth: `loop.poll_events() <asyncio.loop.poll_events> `,
135+ :meth: `loop.process_events() <asyncio.loop.process_events> `, and
136+ :meth: `loop.process_ready() <asyncio.loop.process_ready> ` -- which
137+ decompose a single iteration of the event loop into independently
138+ callable steps. See :ref: `asyncio-event-loop ` for their reference
139+ documentation.
0 commit comments