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

io: update AsyncFd to use Registration #3113

Merged
merged 4 commits into from
Nov 10, 2020
Merged

Conversation

carllerche
Copy link
Member

@carllerche carllerche commented Nov 9, 2020

Removes some code duplication between AsyncFd and Registration.

The AsyncFd::readiness() fn will now return Err when the runtime is dropped. This lines up w/ socket types.

I also reordered some code in async_fd.rs to match the style used elsewhere (structs at the top, impls after).

Removes some code duplication between `AsyncFd` and `Registration`.
// Being awoken by a rt drop does not return an error, currently...
let _ = futures::executor::block_on(readable).unwrap();
// The future was initialized **before** dropping the rt
assert_err!(futures::executor::block_on(readable));
Copy link
Member Author

Choose a reason for hiding this comment

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

@bdonlan wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine, I think - I viewed it as spurious wakeups being allowable so the test tolerated this one as long as we eventually got to an Err.

@Darksonn Darksonn added A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-io Module: tokio/io labels Nov 10, 2020
@carllerche carllerche merged commit e1256d8 into master Nov 10, 2020
@carllerche carllerche deleted the async-fd-use-registration branch November 10, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants