micronaut-projects / micronaut-picocli

Integration between Micronaut and PicoCLI
Apache License 2.0
21 stars 12 forks source link

CLI app as daemon? #25

Open bmarwell opened 5 years ago

bmarwell commented 5 years ago

Task List

Steps to Reproduce

  1. Create a CLI app, with picolli
  2. Create a scheduled bean (a bean with any @Scheduled annotation).
  3. Run the app

Expected Behaviour

The app should run as daemon.

Actual Behaviour

The app does not find a http server and quits.

Environment Information

Example Application

I think it's easy enough to reproduce.

Well If I leave out Picolli and add http-server-netty as a dependency, it works as expected. But in this case, I'd like to see CLI application which I can start using picolli CLI and the scheduler gets configured through picolli.

bmarwell commented 4 years ago

Hi @graemerocher

This was not a question. It was a missing feature.

graemerocher commented 4 years ago

I think you may need the micronaut-runtime dependency to schedule the jobs

bmarwell commented 4 years ago

Thanks, hadn't found it in the docs when I opened this issue. I'll look it up and will give feedback soon.

bmarwell commented 4 years ago

@graemerocher the application will just shutdown if I do not add a while(true) loop.

prshnt commented 1 year ago

I have a similar issue now, was this ever followed up or did you find a solution?

remkop commented 1 year ago

@prshnt I interpreted the suggested solution to be adding a while (true) sleep(1000); loop to make sure the main thread never dies.

prshnt commented 1 year ago

@remkop ah okay. thanks.