Skip to main content

kunobi_daemon/
lib.rs

1//! Shared lifecycle primitives for local background services.
2//!
3//! [`ProcessLock`] keeps a persistent lock inode across replacements.
4//! With the default `async` feature, `Lifecycle` closes request admission and
5//! waits for admitted work. `ensure_current` serializes upgrades through
6//! the caller's live health protocol. The caller owns service-manager commands,
7//! transport, version policy, and the treatment of unfinished work.
8
9#![cfg_attr(feature = "async", doc = include_str!("../README.md"))]
10
11#[cfg(feature = "launch")]
12pub mod launch;
13#[cfg(feature = "local")]
14#[allow(unsafe_code)]
15pub mod local;
16
17pub mod admission;
18mod backoff;
19mod candidate;
20#[cfg(feature = "wire-async")]
21pub mod control;
22mod identity;
23pub use candidate::Candidate;
24#[cfg(feature = "async")]
25pub mod generation;
26#[cfg(feature = "async")]
27mod lifecycle;
28pub mod observation;
29mod ownership;
30pub mod peer;
31mod pid;
32mod publication;
33pub mod readiness;
34pub mod replacement;
35pub mod retry;
36pub mod selection;
37#[cfg(feature = "local-async")]
38pub mod serve;
39pub mod socket_path;
40mod spawn_lock;
41pub mod transport;
42pub mod warmup;
43pub use warmup::{warm_executable, warm_spawn, warm_spawn_until};
44#[cfg(feature = "async")]
45mod upgrade;
46
47pub use identity::{CONTROL_SOCKET, ServiceIdentity, ServicePaths};
48#[cfg(feature = "async")]
49pub use lifecycle::{DrainOutcome, Lifecycle, LifecycleSnapshot, RequestGuard};
50pub use ownership::ProcessLock;
51pub use pid::ProcessId;
52#[cfg(feature = "local")]
53pub use publication::ensure_private_dir;
54pub use publication::{RecordOptions, RecordSlot, publish_record, publish_record_with};
55#[cfg(feature = "async")]
56pub use upgrade::{UpgradeError, ensure_current};
57
58#[cfg(all(feature = "wire", feature = "local"))]
59pub mod client;
60#[cfg(feature = "wire")]
61pub mod wire;