Skip to main content

Module readiness

Module readiness 

Source
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§

ReadinessRegistry
Registry of readiness checks.
ReadinessReport
A single component’s readiness report.
SyncStatusReadiness
Adapter that wraps a SyncStatus to implement Readiness.
VolOracleReadiness
Adapter that exposes routed risk-vol readiness for startup gating.

Traits§

Readiness
Trait for readiness checks.