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...?
If your promise lib has cancellation built in, then adding a timeout to one is easy.