Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Standard Library as Architecture

  • Arc<Config> shares live configuration without transferring ownership to every worker.
  • Arc<[Event]> is an immutable, cheaply cloned action snapshot.
  • HashMap<Id, Job> owns the supervisor registry; Id avoids exposing task internals as identity.
  • AtomicBool represents simple cross-task policy such as paused, queued, and running, while compound process state remains single-owner data.
  • OnceLock<CriticalError> lets an error hook upgrade one runtime error exactly once without returning the hook object.
  • Duration and Instant make debounce and escalation deadlines monotonic.

The crucial borrowing rule is that async workers own their inputs. A handler gets cloned job handles and an Arc event batch, not references into the action worker’s mutable registry. A spawn hook temporarily borrows the command before process creation; it cannot retain that mutable borrow across the process lifetime.