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
- Create database backend (connect, query version).
- Create
AppState. - Load schema cache.
- Start admin server (separate port).
- Start NOTIFY listener (background task).
- 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.