News for hackers. Stuff that matters.
Re:Ask HN: Why don't languages that support Promises include... by SamReidHughes on Friday November 22, 2019 @05:44PM (#21610907)
Well, you have to cancel the task, not ignore it. So you need some standard cancellation hook. And that generally has to be something explicitly handled by the task in question; it cannot automatically percolate all the way down to the deepest sub-task.

If your promise lib has cancellation built in, then adding a timeout to one is easy.

Re:Ask HN: Why don't languages that support Promises include... by 0x0aff374668 on Friday November 29, 2019 @05:52PM (#21667283)
oh, shit. that means if i just send a timeout promise and a worker promise to Promise.race([...]), and the timeout finishes but the worker never does... then I have some unfulfilled promise hanging out somewhere indefinitely? I guess so... if I do Promise.race([p1, p2]) and p1 fulfills and p2 doesn't, p2 is still alive...indefinitely. Am I right or wrong...?