Skip to content

Commit 6528446

Browse files
congzhangzhclaude
andcommitted
gh-145342: Reference the asyncio-guest example collection in the docs
The asyncio-guest project (the proof of concept this feature is based on) has runnable guest-mode examples for Tkinter, Qt, GTK, pygame, Win32 and Tornado hosts; point to it and to Trio's guest mode from the guest mode docs and the module docstring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent c85dc39 commit 6528446

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Doc/library/asyncio-guest.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ See :source:`Doc/includes/asyncio_guest_tkinter.py` for a complete Tkinter
4444
example that embeds asyncio inside ``tkinter.mainloop()`` using
4545
:func:`start_guest_run`.
4646

47+
.. seealso::
48+
49+
The `asyncio-guest <https://github.com/congzhangzh/asyncio-guest>`__
50+
project — the proof of concept this feature is based on — has runnable
51+
examples for many more hosts: Tkinter, Qt (PyQt5/PySide6), GTK,
52+
pygame, Win32 and Tornado.
53+
54+
`Trio's guest mode
55+
<https://trio.readthedocs.io/en/stable/reference-lowlevel.html#using-guest-mode-to-run-trio-on-top-of-other-event-loops>`__,
56+
which pioneered this approach.
57+
4758
.. rubric:: API
4859

4960
.. function:: start_guest_run(async_fn, *args, run_sync_soon_threadsafe, done_callback)

Lib/asyncio/guest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
A single "token" (semaphore permit) ping-pongs between the two threads,
1212
so exactly one of them touches the event loop at any moment.
1313
14-
Inspired by Trio's guest mode (trio.lowlevel.start_guest_run).
14+
Inspired by Trio's guest mode (trio.lowlevel.start_guest_run). The
15+
asyncio-guest project, which this implementation grew out of, has
16+
runnable examples for Tkinter, Qt, GTK, pygame, Win32 and Tornado
17+
hosts:
18+
19+
https://github.com/congzhangzh/asyncio-guest
1520
"""
1621

1722
__all__ = ('start_guest_run',)

0 commit comments

Comments
 (0)