Std.Supervisor

View source →

The structured supervisor surface is source-defined.

Types

  • type Restart = Permanent | Temporary | Transient
  • type Shutdown = Brutal | Timeout
  • type ChildType = Worker | Supervisor
  • type Strategy = OneForOne | OneForAll | RestForOne
  • type Positive = One | More
  • type StrategySpec
  • type ChildSpec

Functions

  • # fn brutal_shutdown() -> Shutdown
  • # fn child(module: Atom, id: Atom) -> ChildSpec
  • # fn child_with(module: Atom, id: Atom, restart: Restart, shutdown: Shutdown, child_type: ChildType) -> ChildSpec
  • # fn child_with_args(a: Type, module: Atom, id: Atom, args: List(a), restart: Restart, shutdown: Shutdown, child_type: ChildType) -> Tuple(RawTerm, Tuple(Atom, Atom, List(a)), Atom, Nat, Atom, List(Atom))

    The MFA argument list is polymorphic for direct homogeneous child specs. Heterogeneous supervisor lists still require the raw BEAM term boundary.

  • # fn child_with_encoded(module: Atom, id: RawTerm, restart: Restart, shutdown: Shutdown, child_type: ChildType) -> ChildSpec
  • # fn child_with_raw_args(module: Atom, id: Atom, args: List(RawTerm), restart: Restart, shutdown: Shutdown, child_type: ChildType) -> ChildSpec
  • # fn child_with_typed_args(a: Type, module: Atom, id: Atom, args: List(a), restart: Restart, shutdown: Shutdown, child_type: ChildType) -> ChildSpec
  • # fn contains_identity(values: List(Syntax), expected: Atom) -> Bool
  • # fn derive_supervisor_family(name: ModuleNameSyntax, definition: SupervisorDefinitionSyntax) -> Syntax
  • # fn derive_typed_child(module: ModuleNameSyntax, identity: Syntax) -> Syntax
  • # fn derive_verified_supervisor(name: ModuleNameSyntax, definition: SupervisorDefinitionSyntax) -> Syntax
  • # fn duplicate_child_identity(children: List(ChildDefinitionSyntax), found: List(Syntax)) -> Bool
  • # fn empty_raw_args() -> List(RawTerm)
  • # fn encoded_child(module: Atom, id: RawTerm) -> ChildSpec

    Preferred typed-ID boundary. The caller resolves BeamEncode(id) and passes the resulting opaque term here; macro expansion itself carries no hidden dictionary argument. At runtime the term is the exact supervisor child ID.

  • # fn more(n: Nat) -> Positive
  • # fn one() -> Positive
  • # fn one_for_all() -> Strategy
  • # fn one_for_one() -> Strategy
  • # fn option_syntax_or(value: Option(Syntax), fallback: Syntax) -> Syntax
  • # fn permanent() -> Restart
  • # fn raw_arg(a: Type, value: a) -> RawTerm

    Explicit raw-term child arguments for a heterogeneous BEAM MFA list. Every element must cross raw_arg/1 at the call site; no typed value is silently widened by this constructor.

  • # fn rest_for_one() -> Strategy
  • # fn shutdown_after(timeout: Nat) -> Shutdown
  • # fn supervision_strategy(strategy: Strategy, intensity: Nat, period: Positive) -> StrategySpec
  • # fn supervisor() -> ChildType
  • # fn supervisor_child_ids(children: List(ChildDefinitionSyntax)) -> List(Syntax)
  • # fn supervisor_child_kind(kind: Syntax) -> Syntax
  • # fn supervisor_child_specs(children: List(ChildDefinitionSyntax)) -> List(Syntax)
  • # fn syntax_constructor(value: Syntax) -> Syntax
  • # fn syntax_key(value: Syntax) -> Option(Atom)
  • # fn temporary() -> Restart
  • # fn transient() -> Restart
  • # fn worker() -> ChildType