Is there any resources you could point to learn more about how to use this async programming with?
Thanks for the links. But they are not clickable :)
done.
So I guess the Generic Associated Types should be the next then?
I was trying to refactor one of my Rust project the other day and almost immediately got hit by the "No async fn in traits" and the "No lifetime on Associated Type" truck. Then few days later, comes this article: https://news.ycombinator.com/item?id=21367691.
If GAT can resolve those two problems, then I guess I'll just add that to my wish list. Hope the Rust team keep up the awesome good work :)
They'll probably be a while still as they're quite a complex feature. But they'll be useful for all sorts.
Yes this is amazing! And refactoring is actually quit easy to my experience, with two projects I've done this with at least.
Re:Async-await on stable Rust
by bluejekyll on Thursday November 07, 2019 @05:49PM
(#21478120)
I think it's straightforward, but it took me quite a while to do correctly in my dns project.
Are there any lessons that would be useful for others to know about?
Re:Async-await on stable Rust
by bluejekyll on Sunday November 10, 2019 @01:42PM
(#21499435)
Yes, I think so. I’ve been planning on writing a blog post.
It was really hard to build asynchronous code until now. You had to clone objects used within futures. You had to chain asynchronous calls together. You had to bend over backwards to support conditional returns. Error messages weren't very explanatory. You had limited access to documentation and tutorials to figure everything out. It was a process of walking over hot coals before becoming productive with asynchronous Rust.
Now, the story is different. Further a few heroes of the community are actively writing more educational materials to make it even easier for newcomers to become productive with async programming much faster than it took others.
Refactoring legacy asynchronous code to async-await syntax offers improved readability, maintainability, functionality, and performance. It's totally worth the effort. Do your due diligence in advance, though, and ensure that your work is eligible for refactoring. Niko wasn't kidding about this being a minimum viable product.