News for hackers. Stuff that matters.
Re:Async Cancellation by noduerme on Friday November 12, 2021 @07:46PM (#29206275)
I'm not sure I understand the distinction. Right now if you throw an exception inside an async function, that "cancels" it and the function's object references are eventually GC'd. You catch the exception outside the promise. I'd imagine external cancellations would work in a similar way. Why is it unsafe for something outside to tell the async function to just throw an exception now, halt and dump its object references? If you're planning on explicitly doing it you'd need to catch it anyway. The difference is being able to do it from outside once the async function is running.

There are no comments on this comment yet.