Packages

t

org.http4s.server

ServerApp

trait ServerApp extends AnyRef

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().

If the server fails to start, the shutdown task is not invoked. More robust resource management is possible through ProcessApp or StreamApp, which are introduced in http4s-0.16 and http4s-0.17, respectively.

Source
ServerApp.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerApp
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def server(args: List[String]): Task[Server]

    Return a server to run

Concrete Value Members

  1. final def main(args: Array[String]): Unit
  2. def requestShutdown(): Unit

    Explicitly request a graceful shutdown of the service.

    Explicitly request a graceful shutdown of the service.

    There is no operational standard for this, but some common implementations include:

    • an admin port receiving a connection
    • a JMX command
    • monitoring a file
    • console input in an interactive session
  3. def shutdown(server: Server): Task[Unit]

    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.