systemprompt_api/services/server/mod.rs
1//! API server assembly, lifecycle, and readiness.
2//!
3//! [`startup`] binds the TCP listener before bootstrap and serves a starting
4//! health probe; [`builder`] composes the full axum router and global
5//! middleware stack; [`runner`] runs the startup reconciliation, swaps the
6//! full router onto the listener, and awaits shutdown. The readiness
7//! signalling surface ([`is_ready`], [`signal_ready`], [`wait_for_ready`]) is
8//! used by external health probes. Discovery, health, metrics, and route
9//! configuration live in the private submodules.
10//!
11//! Copyright (c) systemprompt.io — Business Source License 1.1.
12//! See <https://systemprompt.io> for licensing details.
13
14pub mod builder;
15mod discovery;
16pub mod health;
17mod health_stats;
18
19mod config_fingerprint;
20pub mod health_detail;
21pub mod lifecycle;
22pub mod metrics;
23pub mod ops_metrics;
24mod pool_metrics;
25mod probes;
26pub mod readiness;
27mod replica_identity;
28pub mod routes;
29pub mod runner;
30pub mod scheduler_health;
31pub mod shutdown;
32pub mod startup;
33
34pub use builder::*;
35pub use readiness::{
36 ReadinessEvent, get_readiness_receiver, init_readiness, is_ready, signal_ready,
37 signal_shutdown, wait_for_ready,
38};
39pub use runner::*;
40pub use startup::{EarlyServer, bind_and_serve, starting_router};