Skip to main content

Module server

Module server 

Source
Expand description

HTTP server setup and lifecycle

Creates the main API server and the admin server, wires up graceful shutdown, and starts the NOTIFY listener.

§Startup Sequence

  1. Create database backend (connect, query version).
  2. Create AppState.
  3. Load schema cache.
  4. Start admin server (separate port).
  5. Start NOTIFY listener (background task).
  6. Start main API server.

§Graceful Shutdown

Listens for SIGTERM and Ctrl+C. On receipt, stops accepting new connections and drains in-flight requests before exiting.

Functions§

parse_address
Parse a host string into an IpAddr.
start_notify_listener_public
Background NOTIFY listener using the database backend.
start_server
Start the dbrest server with a pre-constructed backend and dialect.
start_server_with_backend
Start the dbrest server with an already-connected backend.