News for hackers. Stuff that matters.
Re:Rust’s async isn’t colored by pitaj on Thursday March 11, 2021 @03:23PM (#26428569)
AFAIK, you can't do this from JS, you have to have some engine integration, as the busy loop in JS will prevent the event loop from working.

For instance, this will essentially halt your runtime:

    let y;
    Promise.resolve(123).then(x => { y = x; });

    while (!y) {}
    console.log(y)
Re:Rust’s async isn’t colored by lhorie on Thursday March 11, 2021 @04:08PM (#26429021)
Yes, deasync[0] for example, hooks into the Node.js event loop from c++ land

[0] https://www.npmjs.com/package/deasync