Three ways of handling user input
dubroy.com
dubroy.com
I like approach #1 the best. Sure, there are some bugs, but a state diagram would help make it clearer instead of introducing magic.
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/abr... this._promises.forEach(({ reject }) => reject());
Which will throw an Exception and exit the 2 other functions.