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

eventloop: various registration management fixes #48133

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

jkarneges
Copy link
Member

This fixes a few things:

  • Reactor registrations are set up to use a persistent waker. Without this, the reactor triggers the waker only once and then discards it.
  • Registration readiness is cleared after processing. Without this, the reactor won't trigger the registration's waker again after the first event.
  • Timer registrations are automatically removed after activation.

Copy link
Collaborator

@deg4uss3r deg4uss3r left a comment

Choose a reason for hiding this comment

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

Just 1 nit.

Comment on lines 364 to 367
match self.regs.remove(id) {
Ok(()) => Ok(()),
Err(_) => Err(EventLoopError),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be simplified down since we're just throwing away the error:

Suggested change
match self.regs.remove(id) {
Ok(()) => Ok(()),
Err(_) => Err(EventLoopError),
}
self.regs.remove(id).map_err(|_| EventLoopError)

@jkarneges jkarneges merged commit 6d090ea into main Feb 24, 2025
19 checks passed
@jkarneges jkarneges deleted the jkarneges/eventloop-fixes branch February 24, 2025 18:54
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