Skip to main content

readiness_router

Function readiness_router 

Source
pub fn readiness_router<S, F, Fut, E>(check: F) -> Router<S>
where S: Clone + Send + Sync + 'static, F: Fn() -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Result<(), E>> + Send, E: Display,
Expand description

Mount GET /readyz, a readiness probe backed by check.

check runs on every request. Ok(()) renders 200 OK; Err(e) renders 503 Service Unavailable with e.to_string() as the reason — see [soma_http_api::probe::readiness_response].