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
Currently the behavior between trio vs asyncio/curio differs in how ctrl+c is handled. Trio raises KeyboardInterrupt in the main task while asyncio and curio just clean up the tasks and exit. It would be preferable to unify the behavior across all backends so that at least applications using anyio.run() as their entry point could take advantage of this.
For asyncio and curio, this probably requires setting up a signal handler and raising the KeyboardInterrupt exception there. This will be particularly tricky on asyncio which, unlike curio, does not allow specific exceptions to be directly raised on tasks. It may require hijacking the coroutine object of the main task, much like what I did in asyncio_extras.
The text was updated successfully, but these errors were encountered:
Note that Trio will probably switch to delivering some KeyboardInterrupts out of trio.run instead of inside the main task; see python-trio/trio#1537 and linked issues
Currently the behavior between trio vs asyncio/curio differs in how ctrl+c is handled. Trio raises
KeyboardInterrupt
in the main task while asyncio and curio just clean up the tasks and exit. It would be preferable to unify the behavior across all backends so that at least applications usinganyio.run()
as their entry point could take advantage of this.For asyncio and curio, this probably requires setting up a signal handler and raising the
KeyboardInterrupt
exception there. This will be particularly tricky on asyncio which, unlike curio, does not allow specific exceptions to be directly raised on tasks. It may require hijacking the coroutine object of the main task, much like what I did in asyncio_extras.The text was updated successfully, but these errors were encountered: