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

Replace custom event loop with open-source alternative #10

Open
abeltrano opened this issue Jun 11, 2021 · 3 comments
Open

Replace custom event loop with open-source alternative #10

abeltrano opened this issue Jun 11, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@abeltrano
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The code to manage the event loop was written from scratch. During early development, there were not many event loop features that were needed, so a hand-written one allowed rapid prototyping. However, the event loop has become more complicated and so, it may be a better idea to replace the hand-written event loop code with a publicly available, well documented and tested event library.

Describe the solution you'd like
The hand-written event code should be replaced with a well-tested, open-source event library for C. Many popular event libraries available, the following libraries are a good start for consideration:

Describe alternatives you've considered

  • Leave the event loop as it is. This risks more complicated maintenance and requires more bootstrap time for onboarding.

Additional context

  • None
@abeltrano abeltrano added the enhancement New feature or request label Jun 11, 2021
@abeltrano abeltrano self-assigned this Jun 11, 2021
@abeltrano abeltrano changed the title Replace custom eventing code with open-source alternative Replace custom event loop with open-source alternative Jun 11, 2021
@forwardpointer
Copy link
Contributor

I'll look into using libevent for this. It seems the most promising out of the three listed.

@forwardpointer forwardpointer self-assigned this Jul 7, 2021
@forwardpointer
Copy link
Contributor

Would sd-event be a viable option since we are already using libsystemd? It provides an event loop for events based on file IO, signals, and timers.

@abeltrano
Copy link
Contributor Author

Would sd-event be a viable option since we are already using libsystemd? It provides an event loop for events based on file IO, signals, and timers.

Yes, sd-event looks like a great candidate and I can't see a reason why we would prefer the other alternatives over it, given our goals. If we needed to support non-Linux scenarios, it would be a different story, but this project is Linux specific, so not an issue here.

Looking at the sd-event implementation, it's very close to our own event loop so switching to it shouldn't change behavior much, if at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants