Skip to content

Make Poll a Source itself #1875

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evyatark2
Copy link

@evyatark2 evyatark2 commented May 5, 2025

Both epoll and kqueue support listening for other epoll/kqueue file descriptors.

They become readable when an event in the inner epoll/kqueue is ready.

We can expose this feature by making Poll an event::Source.

I gated this feature behind os-ext as this was required to use IoSource.

Additionally, thanks to Rust's borrow checker, there can be no cycles in the listening graph i.e. this will not compile:

let mut poll = Poll::new().unwrap();

poll.registry().register(&mut poll, Token(0), Interest::READABLE).unwrap();

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.

1 participant