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

Fix #411 - Provide accessors for 'events' in PollFd #1517

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

cemeyer
Copy link
Contributor

@cemeyer cemeyer commented Sep 7, 2021

Test: cargo test --test test test_pollfd_events

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

What's the motivation? The PollFd::events method seems especially redundant.

@cemeyer
Copy link
Contributor Author

cemeyer commented Sep 8, 2021

Some earlier discussion:

Based on my own usage of poll in the past, it would be very useful to be able to modify poll interests. For instance, with non-blocking sockets, it is useful to register for POLLOUT to get notifications of when a socket connects and then unregister that interest later.

Not sure events() is redundant with anything -- e.g., if you want to modify a set of PollFds in place and you didn't store the original flags elsewhere, how else would you reconstruct the opaque inner value? But perhaps that is academic. I'm fine dropping events() if you feel it is unnecessary.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

I see. When I said that events was redundant, I misread it. This looks ok to me, though you'll have to rebase to fix the merge conflict.

Test: `cargo test --test test test_pollfd_events`
@cemeyer
Copy link
Contributor Author

cemeyer commented Sep 20, 2021

Thanks! Rebased.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 9a2f86f into nix-rust:master Sep 20, 2021
@cemeyer cemeyer deleted the pollfd_accs branch September 20, 2021 08:50
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.

2 participants