Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Cooperative lifecycle primitives shared by native and browser runtimes.

A StopSource is the authority that may request shutdown. A StopToken is the read-only capability handed to long-running loops. The model is intentionally monotonic: once a source requests stop, every token cloned from that source observes stop forever.

Structsยง

StopSource
Authority that can request cooperative shutdown for one lifecycle scope.
StopToken
Read-only cooperative shutdown capability for long-running loops.