Skip to content
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

Merged
merged 3 commits into from Aug 9, 2019
Merged

select & join #28

merged 3 commits into from Aug 9, 2019

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented Aug 6, 2019

@cramertj
Copy link
Member Author

cramertj commented Aug 6, 2019

also r? @taiki-e @Nemo157 if you have thoughts!

async fn get_book_and_music() -> (Book, Music) {
let book_fut = get_book();
let music_fut = get_music();
join!(book_fut, music_fut)
Copy link
Member

@taiki-e taiki-e Aug 6, 2019

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())

Copy link
Member Author

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.

Copy link
Member

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)]

Copy link
Member

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

@taiki-e
Copy link
Member

taiki-e commented Aug 6, 2019

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.

[`mio`]: https://github.com/carllerche/mio

https://travis-ci.com/rust-lang/async-book/builds/122145149#L817


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cramertj cramertj merged commit d25ddc3 into rust-lang:master Aug 9, 2019
@cramertj cramertj deleted the select branch August 9, 2019 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants