4 ms·
Sounds like you need some structured concurrency. Check out Trio or AnyIO. https://trio.readthedocs.io/ https://trio.readthedocs.io/ It's too bad we got asyn
by O5vYtytb 5y ago
Sounds like you need some structured concurrency. Check out Trio or AnyIO.
https://trio.readthedocs.io/ https://trio.readthedocs.io/
It's too bad we got asyncio as the standard library module, though some SC concepts are going to make it into the library in future Python versions.
- nepthar 5y agoSmall plug for Kotlin as well! Yes, there's new concepts to learn with structured concurrency, but I've been mostly enjoying how quickly it gets out of your way. once properly configured :)
- vasachi 5y agoHow would Trio help with this use-case?
- O5vYtytb 5y agoStructured concurrency gives you exceptions that bubble up the stack like a normal program does, and it cancels other tasks along the way so you don't have zombies. Debugging is thusly easier as well since you keep tasks into a scope (nursery, cancel scope).