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.
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.
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.StreamApp, where main returns a Stream. You can return a Stream that runs forever from a ServerBuilder with
.serve
. UseStream.bracket
to compose resources in a simpler way than overridingshutdown
.