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

Implement graceful stopping of app #423

Open
joseferben opened this issue Mar 8, 2021 · 0 comments
Open

Implement graceful stopping of app #423

joseferben opened this issue Mar 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@joseferben
Copy link
Contributor

joseferben commented Mar 8, 2021

Goal

When pressing Ctrl-C when the Sihl app is running, graceful stop should happen.

Todo

  1. store ref to current app and start ctx
  2. loop forever (in Lwt_main.run)
  3. when command finishes, exit loop
  4. when SIGINT comes, exit loop
  5. call stop app
let stop app ctx = 
  let* () = app.before_stop ctx in
  print_endline "CORE: Stop services"; 
  let* () = Core_container.stop_services ctx app.services in 
  print_endline "CORE: Services stopped"; 
   app.after_stop ctx 
@joseferben joseferben added the enhancement New feature or request label Mar 8, 2021
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

No branches or pull requests

1 participant