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

Added FuturesUnordered chapter #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

capnhawkbill
Copy link

I added the chapter about FuturesUnordered, it's a bit short but I think it gets the message across

Comment on lines +9 to +12
Because `FuturesUnordered` implements the `Stream` trait using `.next()`
on it will return a `Future` which returns the return value from one of
the futures inside of an `Option`.
It will return `None` when all futures are completed.
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be even more concise, something like

Suggested change
Because `FuturesUnordered` implements the `Stream` trait using `.next()`
on it will return a `Future` which returns the return value from one of
the futures inside of an `Option`.
It will return `None` when all futures are completed.
`FuturesUnordered` implements a `Stream` trait over the
output of the futures in any order.

The example implies how to use that Stream (and hopefully we have dedicated docs for that too).

Copy link
Author

Choose a reason for hiding this comment

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

Yes I agree this is a lot clearer

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

2 participants