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 }}
This repository was archived by the owner on Dec 21, 2025. It is now read-only.
PR #188 added some initial support for an curio-asyncio bridge. I've extended it with a different approach in which you can create a Curio stand-in for the asyncio event loop and submit coroutines to it. Like this::
from curio.bridge import AsyncioLoop
import asyncio
loop = AsyncioLoop()
# an asyncio coroutine - not curio
async def aio_coro(x, y):
await asyncio.sleep(2)
return x + y
# A curio coroutine - not asyncio
async def main():
result = await loop.run_until_complete(aio_coro(2, 2))
print(result)
run(main())
Under the covers, asyncio is running the event loop in a different thread. The event loop gets shut down automatically when the Curio kernel gets shutdown.
This issue is further discussion about this. What should curio-asyncio bridging look like in a ideal world?