Expand description
Readiness framework for service startup gating.
This module provides a generic readiness registry that tracks multiple readiness checks (e.g., snapshot sync, database connection, etc.) and provides a unified interface for:
- GET /ready endpoint (200 OK vs 503 Service Unavailable)
- readiness_middleware (block requests until service is ready)
§Example
ⓘ
use std::sync::Arc;
use hypercall::readiness::{ReadinessRegistry, SyncStatusReadiness};
use hypercall::snapshot::SyncStatus;
let sync_status = Arc::new(SyncStatus::new());
let check = Arc::new(SyncStatusReadiness::new("portfolio", sync_status.clone()));
let registry = ReadinessRegistry::new(vec![check]);
// Initially not ready
assert!(!registry.all_ready());
// After catchup completes
sync_status.set_ready();
assert!(registry.all_ready());Structs§
- Readiness
Registry - Registry of readiness checks.
- Readiness
Report - A single component’s readiness report.
- Sync
Status Readiness - Adapter that wraps a SyncStatus to implement Readiness.
- VolOracle
Readiness - Adapter that exposes routed risk-vol readiness for startup gating.
Traits§
- Readiness
- Trait for readiness checks.