[v3] Late service registration and error handling overhaul#4066
Merged
fbbdev merged 30 commits intoFeb 19, 2025
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR provides three QOL improvements for the runtime side of the binding/service system and fixes a major bug:
App.RegisterServicefor registering services after app creation (but beforeApp.Run);MarshalErrorfunctions for custom handling (see the updated docs);App.Run).Additionally, it adds a test harness for end-to-end tests of the application object and uses it to test service startup/shutdown sequences and error handling. Note that the go test framework spawns one process per package, hence – against go conventions – I had to split tests over many packages because at most one application run per process is supported.
🚨 Breaking changes 🚨
There are a few minor breaking changes necessitated by the restructuring described above (should not affect users in practice):
ServiceStartuphooks are now invoked whenApp.Runis called, not inapplication.NewServiceStartuperrors are now returned fromApp.Runinstead of terminating the processType of change
How Has This Been Tested?
Ran the test suite including new and updated tests, verified that everything is passing; tested examples manually.
Test Configuration
Checklist:
docs/src/content/docs/changelog.mdxwith details of this PRSummary by CodeRabbit
New Features
Improvements
Documentation
Tests