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

pbio/sys: Refactor status events to be handled synchronously #299

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

laurensvalk
Copy link
Member

@laurensvalk laurensvalk commented Mar 19, 2025

We never quite adopted events extensively across pbio. We only have a status set/clear handler in pbsys, with only one top level event listener at pbsys_hmi_handle_status_change. We can call it directly without casting the event data value to void * onto an event queue, and then back again. Given the limited case we had, this was harder to follow than we ultimately needed, and risked overflowing the event queue as stated in an old REVISIT that we can now address.

Doing this simplifies the introduction of #298 by ensuring we don't need any event queue at all.

@coveralls
Copy link

coveralls commented Mar 19, 2025

Coverage Status

coverage: 56.882% (+0.4%) from 56.477%
when pulling 6102eef on status
into 962e44b on master.

This refactors a few names without changing any code, setting the stage for the next commit where we update the sys background process.

We never quite adopted events across pbio, but only had a status set/clear handler in pbsys, with only one top level handler at pbsys_hmi_handle_status_change. Later, we can call it directly without casting the event data value to void * and back.
This was using broadcast, but there was ultimately only one receiver for this data. We can simplify this and avoid the risk of overrunning the event queue by calling it synchronously, which is safe for this event.

After the refactoring in the previous commit, this is now a trivial change.
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