rings_core/lifecycle/mod.rs
1//! Cooperative lifecycle primitives shared by native and browser runtimes.
2//!
3//! A [`StopSource`] is the authority that may request shutdown. A [`StopToken`]
4//! is the read-only capability handed to long-running loops. The model is
5//! intentionally monotonic: once a source requests stop, every token cloned from
6//! that source observes stop forever.
7
8mod stop;
9
10pub use stop::StopSource;
11pub use stop::StopToken;
12
13#[cfg(test)]
14mod test_lifecycle;