arcature 2026.2.0

Arcature application framework: a high-level Application facade over the certified Arcature subsystems, with the low-level Axum/Tower escape hatch preserved.
Documentation
//! The application lifecycle state machine, readiness gates, and drain
//! hooks (AP2.1-10).
//!
//! This module owns the production process lifecycle: the
//! `STARTING → READY → DRAINING → STOPPED` state machine, the
//! application-registered readiness checks that gate `/up/ready`, and the
//! `DrainHook` seam the Realtime (AP2.1-8) and jobs lanes wire into for
//! coordinated graceful shutdown. One file owns one responsibility
//! (AGENTS.md §1):
//!
//! - [`state`] — the lifecycle state values and their atomic encoding.
//! - [`ready`] — the application-registered readiness gates.
//! - [`hook`] — the `DrainHook` trait and the shutdown-hook registry (the
//!   seam the master wires Realtime/jobs into).
//! - [`coordinator`] — the [`Lifecycle`] coordinator handle (state + readiness
//!   + hooks; the `live()` / `ready()` queries; the transitions).
//! - [`signal`] — the production termination signal future (Unix SIGTERM/
//!   SIGINT, Windows Ctrl-C/Ctrl-Break). `macros`-feature-gated (tokio
//!   `signal`).
//!
//! The state machine and readiness gates are pure `std` (atomic + `Arc`) so
//! they compile with no feature flags; an expert user on a custom runtime
//! can build a [`Lifecycle`], mount the framework's [`crate::health`] routes,
//! and drive their own shutdown. The orchestrated paths
//! (`serve_with_health` / `run_with_health`) tie the lifecycle to the
//! certified Tokio runtime and the engine's subsystem startup/shutdown.

mod coordinator;
mod hook;
mod ready;
// `signal` (the production termination-signal future) needs the certified
// Tokio `signal` sub-feature. It is gated by the same condition as
// `run_with_health` (the only consumer): `macros` + at least one lifecycle
// subsystem feature. Under `macros`-alone the plain `run` path is the
// correct entry point and has no termination-signal consumer.
#[cfg(all(
    feature = "macros",
    any(
        feature = "db",
        feature = "cache",
        feature = "storage",
        feature = "mail",
        feature = "jobs"
    )
))]
mod signal;
mod state;

pub use coordinator::Lifecycle;
pub use hook::{DrainError, DrainHook};
pub use ready::ReadinessCheck;
pub use state::LifecycleState;

// `termination_signal` needs the certified Tokio `signal` sub-feature, which
// the `macros` feature brings. Exported only when `run_with_health` is
// compiled (same gate).
#[cfg(all(
    feature = "macros",
    any(
        feature = "db",
        feature = "cache",
        feature = "storage",
        feature = "mail",
        feature = "jobs"
    )
))]
pub use signal::termination_signal;