-
I've set a sample zio-http project similar to https://github.com/zio/zio-http#getting-started. When running On zio-http page, it mentions using sbt-revolver plugin for watching sources during dev. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
IIRC, sbt-revolver is interrupting a running process when it detects changes. Mills If you want your server process to stop and restart whenever its sources have changed, you can try to use $ mill inspect main.runBackground
[1/1] inspect
main.runBackground(JavaModule.scala:697)
Runs this module's code in a background process, until it dies or
`runBackground` is used again. This lets you continue using Mill while
the process is running in the background: editing files, compiling, and
only re-starting the background process when you're ready.
You can also use `-w foo.runBackground` to make Mill watch for changes
and automatically recompile your code & restart the background process
when ready. This is useful when working on long-running server processes
that would otherwise run forever
Inputs:
main.runClasspath
main.forkArgs
main.forkEnv
main.finalMainClass
main.forkWorkingDir
main.runUseArgsFile To stop such background process, you can run If this is not what you're looking for and you still think you discovered an issue, please provide a MCVE. |
Beta Was this translation helpful? Give feedback.
-
Awesome, just tested with |
Beta Was this translation helpful? Give feedback.
-
BTW, if I run |
Beta Was this translation helpful? Give feedback.
-
Noticed that as well, if you do:
|
Beta Was this translation helpful? Give feedback.
IIRC, sbt-revolver is interrupting a running process when it detects changes. Mills
JavaModule.run
does not. Instead, it would re-run once the process has ended and only after changes were detected.If you want your server process to stop and restart whenever its sources have changed, you can try to use
JavaModule.runBackground
.