Return a server to run
Return a task to shutdown the application.
Return a task to shutdown the application.
This task is run as a JVM shutdown hook, or when org.http4s.server.ServerApp.requestShutdown is explicitly called.
The default implementation shuts down the server, and waits for it to finish. Other resources may shutdown by flatMapping this task.
Starts a server and gracefully terminates at shutdown. The server is terminated and the shutdown task is run either by a JVM shutdown hook or an invocation of
requestShutdown()
.More robust resource management is possible through
ProcessApp
orStreamApp
, which are introduced in http4s-0.16 and http4s-0.17, respectively.(Since version 0.16) Prefer org.http4s.util.ProcessApp, where main returns a Process. You can return a Process that runs forever from a ServerBuilder with
.serve
. UseProcess.bracket
to compose resources in a simpler way than overridingshutdown
.