python-trio / trio-asyncio

a re-implementation of the asyncio mainloop on top of Trio
Other
188 stars 38 forks source link

Use greenlets rather than threads for sync loop #137

Closed oremanj closed 8 months ago

oremanj commented 8 months ago

Fixes #132.

jakkdl commented 8 months ago

Could perhaps add a regression test that spins up an ipython prompt and attempts to import trio_asyncio?

oremanj commented 8 months ago

I tested that manually; it doesn't seem worth adding a test dependency on IPython just for this. The previous error was because the event loop is a per-thread construct and we were trying to run it in a different thread; honestly I'm surprised it appeared to work as far as it did.