docs/generated/contracts.mdgenerated from code

Reference · 1 min read

incarnations

Contracts: incarnations.

Source: crates/lvcs-runtime/src/lib.rs.

ruston main
1/// Mints the [`ActorId`] for each spawn, so every spawn of a `(kind, key)`2/// is a new incarnation, across daemon restarts too (discussion:owner/403).3///4/// At startup the shell passes the `ActorId` of every journal entry to5/// [`observe`](Self::observe); after that, [`next`](Self::next) mints the id6/// for each spawn. An incarnation that handled no events leaves no journal7/// entry, so its number may be minted again after a restart; no entry8/// refers to it. Every clone mints from the same table, so a machine's9/// executor mints the ids of the machines it starts without the shell10/// (owner/18; the runtime synchronizes, discussion:owner/436).11#[derive(Debug, Clone, Default)]12pub struct Incarnations {13    /// The next incarnation to mint, by kind and then key.14    next: Arc<Mutex<BTreeMap<&'static str, BTreeMap<String, u64>>>>,15}