1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! **Stratum 7 — Concurrency Primitives**
//!
//! Lightweight threads of execution and cooperative cancellation, built from Strata 0–6.
//!
//! | Submodule | Provides | Depends on |
//! |-----------|----------|------------|
//! | [`fiber_id`] | [`FiberId`] branded `u64` | `std::sync::atomic` only |
//! | [`cancel`] | [`CancellationToken`], [`check_interrupt`] | Stratum 6 (`runtime::Never`, `runtime::run_*`), `async_notify` |
//! | [`fiber_handle`] | [`FiberHandle`], [`FiberStatus`], fiber utilities | Stratum 6 (`runtime::{run_blocking, run_async, Never}`), Stratum 4 (`failure::{Cause,Exit}`), [`fiber_id`] (this stratum), `deferred`, `scope` |
//!
//! ## Design
//!
//! Concurrency in this system is modelled through typed, observable _fibers_:
//!
//! ```text
//! FiberId — stable, branded identifier (monotonic u64)
//! FiberHandle — typed reference to a spawned fiber's completion rendezvous
//! FiberStatus — non-blocking state snapshot (Running | Succeeded | Failed | Interrupted)
//! CancellationToken — cooperative propagating interrupt signal
//! ```
//!
//! The key operations follow the Effect.ts fiber algebra:
//!
//! ```text
//! join[A, E]: FiberHandle[A, E] → Result[A, Cause[E]]
//! awaitExit[A, E]: FiberHandle[A, E] → Effect[Exit[A, E], Never, ()]
//! interrupt[A, E]: FiberHandle[A, E] → Bool
//! zip, orElse, map — combinators over handles
//! ```
//!
//! ## Public API
//!
//! Re-exported at the crate root (via [`crate::runtime`] for backward compatibility):
//! [`FiberId`], [`FiberHandle`], [`FiberStatus`], [`CancellationToken`], [`check_interrupt`],
//! [`fiber_all`], [`interrupt_all`], [`fiber_succeed`], [`fiber_never`].
pub use ;
pub use ;
pub use FiberId;
pub use ;