3 ms·
These 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.
by rexpan 5y ago
These 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.