5 ms·
For anyone wanting to understand how to implement a basic engine for std::future from scratch, I mashed some code until it worked: https://gist.github.com/jkarn
by jkarneges 7y ago
For anyone wanting to understand how to implement a basic engine for std::future from scratch, I mashed some code until it worked: https://gist.github.com/jkarneges/cb1ee686ef97bb05ebe04b5fc67536f4 https://gist.github.com/jkarneges/cb1ee686ef97bb05ebe04b5fc6...
It's based mostly on this article, which predates std::future: https://www.viget.com/articles/understanding-futures-in-rust-part-1/ https://www.viget.com/articles/understanding-futures-in-rust...
- pimeys 7y agoHere's another example how to mix futures 0.1 and async/await together. https://github.com/pimeys/blocking_test/ https://github.com/pimeys/blocking_test/
- jadbox 7y agoThank you. We really need more examples... and hopefully a full guide to futures/async. As someone currently in the outskirts of the Rust community, it's really hard to 'peer inside' what's happening and how to use it in practical applications. It's a matter of time, but it's just so exciting xD
- steveklabnik 7y agoThere is an “async book” in the works, by the working group. You’re 100% right that good docs will be important here!