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

Expose the Events structure instead of using Vec<Event> #66

Closed
notgull opened this issue Dec 30, 2022 · 0 comments · Fixed by #133
Closed

Expose the Events structure instead of using Vec<Event> #66

notgull opened this issue Dec 30, 2022 · 0 comments · Fixed by #133

Comments

@notgull
Copy link
Member

notgull commented Dec 30, 2022

My main complaint with the polling API is the fact that it doesn't expose sys::Events; instead, it reads events from the sys::Events into a Vec<Event>. In practice, this usually means that:

  1. System events are read to Events.
  2. poller events are read out of the Events.
  3. poller events are appended to a Vec<Event>.
  4. Downstream, the poller events are then drained out of that Vec<Event> and used to react to events.

Steps 1 and 2 are necessary, but steps 3 and 4 feel unnecessary. It would be nice if the Events structure was exposed and given a real API. Is there any particular reason why polling was designed to use Vec<Event> in the first place?

This would be a breaking change, but there's already breaking changes on the horizon (#38) so we should probably at least plan for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant