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

Centralize async callback storage in preparation for IPC/error handling #22

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

stevenewald
Copy link
Owner

This is in preparation for error handling and IPC, which will both call async user callbacks. With the new ProcessCallbackStorage, simply adding a callback (now using etl::delegate) will cause it to eventually be triggered by the scheduler. Nice!

Aside: right now we're using the pattern of many things being a singleton, while another option is to have the scheduler own everything (hierarchy).

One could argue the latter is better practice because singletons can be messy, but I'd argue most(all?) of the singletons we have right now must be singletons (how could you have two button drivers? two schedulers?).

However, this makes visualizing dependencies (constr/deconstr and general call patterns) much harder.

In reality, it doesn't matter, just interesting to think about.

@stevenewald stevenewald merged commit 6d6d0b1 into main Nov 13, 2024
1 check passed
@stevenewald stevenewald deleted the callbacks branch November 13, 2024 15:17
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