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

daemon: implement an event loop for the main thread #647

Merged
merged 7 commits into from
May 15, 2024

Conversation

sandydoo
Copy link
Member

  • Refactor the main blocking thread into an event loop to make it possible to manage internal daemon state. For example, react to new messages, add and remove active sockets, etc.
  • Add ping-pong messages to the protocol to allow for liveness checks.
  • Track and handle active client sockets.
  • Remove code that disabled non-blocking mode for client connections. This causes hangs in certain situations. Everything now works perfectly fine without this.

Not a safe operation, apparently.
- Add an event loop to the daemon.
- Track client sockets that connect to the daemon.
- Add ping/pong messages to the protocol.
@sandydoo sandydoo marked this pull request as ready for review May 14, 2024 22:12
@sandydoo sandydoo requested a review from domenkozar May 15, 2024 13:24
@domenkozar domenkozar merged commit 4eddc92 into master May 15, 2024
8 checks passed
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.

None yet

2 participants