-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use ComponentLifecycle in HBApplication #142
Use ComponentLifecycle in HBApplication #142
Conversation
Codecov ReportBase: 78.15% // Head: 78.15% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
=======================================
Coverage 78.15% 78.15%
=======================================
Files 72 72
Lines 3094 3094
=======================================
Hits 2418 2418
Misses 676 676
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
LGTM |
One issue, which is an issue with service lifecycle to some degree. ComponentLifecycle on its own does not catch interrupts like Ctrl+C. |
Oh, I hadn't realized that. Maybe we could fix it by adding something like a |
Yeah that would work. Might as well keep the same terminology as EventLoopGroupProvider which is |
Agreed, I'll update the PR later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
A couple of minor nits
Co-authored-by: Adam Fowler <adamfowler71@gmail.com>
In my server applications I usually have two servers running, one for the public API of a service and one for the admin API (e.g. to expose a
/metrics
route), but I still want them to run in the same process/container. I'd like to be able to useServiceLifecycle
to pull them all together but that's currently not possible sinceHBApplication
creates its own top-level lifecycle. If we were to useComponentLifecycle
instead, anHBApplication
and all its lifecycle tasks could be registered as a subcomponent of a larger lifecycle, which could look like this: