3 ms·
> you do something like let data = file.read(); and the it just sits there on that line until the read is done and then your data has the actual bytes in it and
by zozbot234 3y ago
> you do something like let data = file.read(); and the it just sits there on that line until the read is done and then your data has the actual bytes in it and you just use them and go on with your life.
That's exactly how async/await works, except that it translates to state machines under the hood which gives you great performance. No need to mess with threading models, at all.
- vacuity 3y agoYeah, Rust's async/await and lightweight threads are functionally very similar. Function coloring is a problem with async/awaitt, though (for now?).