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

[feature] Add launcher shutdown hook #10

Merged
merged 1 commit into from
Feb 1, 2025
Merged

[feature] Add launcher shutdown hook #10

merged 1 commit into from
Feb 1, 2025

Conversation

fpapon
Copy link
Member

@fpapon fpapon commented Feb 1, 2025

No description provided.

@fpapon fpapon added the enhancement New feature or request label Feb 1, 2025
try (final var launcher = new Launcher(args)) {
Configuration configuration = launcher.container.lookup(Configuration.class).instance();
useHook.set(Boolean.parseBoolean(configuration.get("fusion.launcher.useHook").orElse("false")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of a field instance, can be a local final boolean

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

@@ -130,6 +130,9 @@ TIP: listening to `Start` event can enable a lazy instance (`@ApplicationScoped`

TIP: an event can have more parameters, other parameters will be considered as injections (but the lookup will be destroyed after the method call if it is not `@ApplicationScoped`)

TIP: When using the Launcher provided by the Fusion, you can use the shutdown hook to call the `container.close()` method and send the `Stop` event by settings the system properties
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention "fusion configuration", ie system props, env var (useful for k8s).
Can also be worth mentioning signals it maps to (still k8s case)?

@fpapon fpapon requested a review from rmannibucau February 1, 2025 19:30
@fpapon fpapon merged commit 933236d into master Feb 1, 2025
4 checks passed
@fpapon fpapon deleted the hook-launcher branch February 1, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants