-
Notifications
You must be signed in to change notification settings - Fork 249
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
select & join #28
select & join #28
Conversation
async fn get_book_and_music() -> (Book, Music) { | ||
let book_fut = get_book(); | ||
let music_fut = get_music(); | ||
join!(book_fut, music_fut) |
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.
Off-topic: Should we rewrite join!/try_join! with proc-macro to allow passing expressions directly here?
join!(get_book(), get_music())
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.
That would be nice! I was actually just thinking the same thing.
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.
@@ -0,0 +1,183 @@ | |||
#![cfg(test)] | |||
#![feature(async_await)] | |||
|
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.
Seems a recursion limit error has occurred in this crate. https://travis-ci.com/rust-lang/async-book/builds/122145149#L961
Another error seems to be that mio has moved to tokio-rs (https://github.com/tokio-rs/mio) and the following link is out of date. async-book/src/02_execution/05_io.md Line 112 in 822a3d3
https://travis-ci.com/rust-lang/async-book/builds/122145149#L817 |
src/06_multiple_futures/03_select.md
Outdated
|
||
One thing you may have noticed in the first example above is that we | ||
had to call `.fuse()` on the futures returned by the two `async fn`s, | ||
as well as pinning them with `pin_mut`. Both of these calls necessary |
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.
as well as pinning them with `pin_mut`. Both of these calls necessary | |
as well as pinning them with `pin_mut`. Both of these calls are necessary |
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.
LGTM!
r? @yoshuawuyts @nikomatsakis