You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow re-entry into the event loop using tokens #256
For applications where all that is needed is fire and forget, the implementations could be trivial, even assuming today's current_token() implementation (returns the TrioToken in Trio, and the event loop in asyncio).
The only slight niggle is that if the loop has exited then asyncio raises RuntimeError whereas Trio raises trio.RunFinishedError, but the latter derives from RuntimeError so that could be the documented exception type.
More complex applications need to wait until the sync_fn has finished or allow async callbacks, and I recognise that's trickier.
Activity
Allow re-entry into the event loop using tokens #256
Allow re-entry into the event loop using tokens #256
arthur-tacca commentedon Nov 15, 2022
For applications where all that is needed is fire and forget, the implementations could be trivial, even assuming today's
current_token()implementation (returns theTrioTokenin Trio, and the event loop in asyncio).In trio:
In asyncio:
The only slight niggle is that if the loop has exited then asyncio raises
RuntimeErrorwhereas Trio raisestrio.RunFinishedError, but the latter derives fromRuntimeErrorso that could be the documented exception type.More complex applications need to wait until the
sync_fnhas finished or allow async callbacks, and I recognise that's trickier.Added support for using tokens to enter the event loop from foreign tâĶ
Added support for using tokens to enter the event loop from foreign tâĶ
chore(deps-dev): bump the python-dependencies group in /.github/actioâĶ
Bump anyio from 4.10.0 to 4.11.0 in /tools (#6044)
pip: bump the pip-updates group across 1 directory with 10 updates (#448
Bump anyio from 4.10.0 to 4.11.0 in /tools (bazelbuild#6044)
chore(deps): bump the python group with 26 updates (#125)