4 ms·
I'm assuming the loop would terminate with an exception... like `await events.pointermove` would raise some cancellation exception that would be silently captur
by ianbicking 5y ago
I'm assuming the loop would terminate with an exception... like `await events.pointermove` would raise some cancellation exception that would be silently captured.
- jayd16 5y agoSounds like the Abro runtime never resumes the tasks so how could they throw?
- ianbicking 5y agoOh... on second thought I realize the exception would have to come from `event.pointermove` (for example), and that object doesn't know anything about the receiver or whether it should cancel. So yeah, this does seem problematic.
- jayd16 5y agoAre you worried about when the case when an exception should be thrown from the thing being awaited? I'm not familiar with Arbo but usually the promise holds on to the exception until its observed. It could be that Arbo is configured to ignore the exception if the task is already cancelled.
- rexpan 5y agoThese 3 functions will stop on `await event.xxx` (if not, they will continue to execute or terminate). So when one of the functions is terminate https://github.com/pdubroy/handling-user-input/blob/main/abro.js#L54 https://github.com/pdubroy/handling-user-input/blob/main/abr... await Promise.any(fibers.map((f) => f.run())); fibers.forEach((f) => f.terminate()); Abro will reject the promise of these `await event.xxx` https://github.com/pdubroy/handling-user-input/blob/main/abro.js#L54 https://github.com/pdubroy/handling-user-input/blob/main/abr... this._promises.forEach(({ reject }) => reject()); Which will throw an Exception and exit the 2 other functions.