Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In Python, cancellation causes an exception to be injected at the await site, which allows it to clean up whatever resources it likes (even if that means making other async calls). If you use Trio or the new TaskGroup in asyncio (inspired by Trio) then an exception leaking out of one task causes the others to be cancelled, and then the task group waits for all tasks to complete (successfully, with exception, or cancelled). It's extremely nice and easy to write reliable programs.

But not in JavaScript.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: