-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compat blog post take 2 #1357
Compat blog post take 2 #1357
Conversation
* Remove the deprecated spawning stuff * Try to refer to std::future rather than futures@0.3 where appropriate * Add lots of links
Aside from the one nit and updating to add IO/spawn info, this LGTM so far! |
One, thing that might be useful to add is something about sink support with tokio. As I used this post to convert my project to async/await. I was a bit confused on how to approach sinks. I ended up with using some of the tokio compat features. So maybe a mention about it would be helpful imo. |
@LucioFranco yeah, probably worth adding a section about |
Add IO and spawning sections, update final example to use IO compatibility.
Added info on |
@Nemo157 Great! I just took a look at it again, it def clears some things up. I am still slightly struggling to understand where the This btw is my hacky solution to using std await and while let Some(msg) = await!(rx.next()) {
println!("Sending: {:?}", msg);
{
use tokio::prelude::SinkExt;
if let Err(e) = await!(sink.send_async((msg, to))) {
println!("Sending message: {}", e);
}
}
} I would also maybe add a |
@LucioFranco thanks, those are some good points. I think an example of using |
Sorry about the big delay on this again, I'll try and finish this off before 2019! |
Updated now that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read through it again looks good!
@Nemo157 Read through it as somebody outside of the working team and just excited about async/await. It looks great and is easy to understand. Super excited! |
How would one go about using |
@archseer I have no real experience using Tokio's use futures::future::FutureExt;
use futures::compat::Future01CompatExt;
select! {
foo = some_tokio_future().compat().fuse() => { ... },
bar = some_other_tokio_future().compat().fuse() => { ... },
}; |
@cramertj I've checked the example code works with the new release and all the links are correct, I think this is good to publish finally 😁 |
Nice! |
Replacement for #1226 (@MajorBreakfast I hope you're ok with me taking this over).
I still want to add some info on the spawn and IO compat that's been added since this was originally written, and I need to actually test the snippets against the new API. Should get to that over the weekend at some point.