Skip to main content

Module cancel

Module cancel 

Source
Expand description

Cooperative cancellation for in-flight provider work.

CancellationToken is a thin Arc<AtomicBool> plus a waker list so async tasks can yield until cancellation flips. No external runtime dependency: Arc<AtomicBool> + std::sync::Mutex<Vec<Waker>> works equivalently on native and WASM (?Send).

Phase 3 always passes None from the resolver — providers that opt into listening for cancellation can do so without breaking the trait signature when chartml 5.x starts emitting tokens (e.g. for tab-close cleanup).

Structs§

CancellationToken
Cooperative cancellation handle. Clone is cheap (just an Arc).
Cancelled
Future returned by CancellationToken::cancelled().