Skip to main content

aster_forge_runtime/
lib.rs

1//! Shared runtime primitives for Aster services.
2//!
3//! This crate contains small process/runtime building blocks that are not tied
4//! to a concrete product domain: health report aggregation, startup phase
5//! coordination, shutdown phase coordination, buffered side-effect writing, and
6//! termination signal handling. Product crates still own runtime state, audit
7//! events, background task shutdown order, database handles, and
8//! service-specific readiness checks.
9#![cfg_attr(
10    not(test),
11    deny(
12        clippy::unwrap_used,
13        clippy::unreachable,
14        clippy::expect_used,
15        clippy::panic,
16        clippy::unimplemented,
17        clippy::todo
18    )
19)]
20
21pub mod buffered;
22pub mod component;
23pub mod health;
24pub mod lease;
25pub mod lifecycle;
26pub mod shutdown;
27pub mod startup;
28
29pub use buffered::{
30    BufferFlushError, BufferStopReport, BufferedBatchConfig, BufferedWriterEvent,
31    BufferedWriterSnapshot, BufferedWriterState, ManagedBatchWriter, OverflowPolicy,
32    RecordAdmission, RecordError, WriteFailure, WriteFailureCause, WriteFailureClass,
33};
34pub use component::{
35    RuntimeComponentBuilder, RuntimeComponentBundle, RuntimeComponentDescriptor,
36    RuntimeComponentGraphError, RuntimeComponentKind, RuntimeComponentRegistry,
37    RuntimeShutdownDescriptor, RuntimeStartupDescriptor, RuntimeTaskDescriptor,
38};
39pub use health::{
40    HealthCheckDescriptor, HealthCheckOptions, HealthCheckRegistry, HealthCheckRegistryBuilder,
41    HealthCheckRequirement, HealthCheckScope, HealthCheckScopes, HealthComponentDetail,
42    HealthComponentDetailValue, HealthComponentReport, HealthMetricsRecorder, HealthStatus,
43    SystemHealthReport,
44};
45pub use lease::{
46    DEFAULT_RUNTIME_LEASE_RETRY_INTERVAL, DEFAULT_RUNTIME_LEASE_TTL, RuntimeLeaseAcquire,
47    RuntimeLeaseClaim, RuntimeLeaseConfig, RuntimeLeaseOwner, RuntimeLeaseStore,
48    new_runtime_lease_owner_id, run_runtime_lease_supervisor,
49};
50pub use lifecycle::{
51    AsterRuntime, AsterRuntimeBuilder, AsterRuntimeComponent, AsterRuntimeError,
52    RuntimeComponentBundleRegistration, RuntimeComponentWithShutdown, RuntimeServiceComponent,
53    ServiceLifecycle, ShutdownResourceComponent, TryRuntimeComponentWithShutdown,
54    runtime_component, runtime_component_with_shutdown, shutdown_resource_component,
55    shutdown_resource_component_after, try_runtime_component_with_shutdown,
56};
57pub use shutdown::{
58    RuntimeSignalError, ShutdownCoordinator, ShutdownPhaseReport, ShutdownPhaseStatus,
59    ShutdownReport, TerminationSignal, log_shutdown_report, spawn_termination_signal_handler,
60    wait_for_termination_signal,
61};
62pub use startup::{
63    RuntimeTempDirError, StartupCoordinator, StartupPhaseFailurePolicy, StartupPhaseOutcome,
64    StartupPhaseReport, StartupPhaseStatus, StartupReport, create_runtime_temp_dir_guard,
65    ensure_runtime_temp_dir, run_optional_startup_phase, run_required_startup_phase,
66};