Expand description
OTP-shaped supervisor trees, encoded as a typed :kind Supervisor
caixa with a strategy + restart-policy children list.
See theory/INSPIRATIONS.md §II.2 + §III.2 for the prior-art frame
(Erlang OTP supervisor + Lunatic supervisor strategies as Rust types).
(defcaixa
:nome "my-app-root"
:versao "0.1.0"
:kind Supervisor
:estrategia OneForOne
:max-restarts 5
:restart-window "60s"
:children ((:caixa "worker" :versao "^0.1" :restart Permanent)
(:caixa "cache-server" :versao "^0.1" :restart Transient)
(:caixa "scratch-job" :versao "^0.1" :restart Temporary)))wasm-operator (M3) walks the tree, materializes one ComputeUnit per child, and applies the strategy on child failure. The Rust types here are the typed contract; the runtime owns lifecycle.
Modules§
- duration_
codec - Shared duration string codec for the typed slots that take a
duration (
restart_window,MeshPolicy::timeout,CircuitBreaker::window, …). Public socrate::aplicacaocan reuse it without duplicating the parser. - duration_
codec_ required - Required-Duration variant for fields that aren’t Option
.
Structs§
- Child
Spec - One child entry in the supervisor’s
:childrenlist. - Restart
Policy Parse Error - Auto-generated parse error for the matching
FromStrKindimpl. - Restart
Strategy Parse Error - Auto-generated parse error for the matching
FromStrKindimpl. - Supervisor
Spec - Supervisor-typed slots that live alongside the standard Caixa
fields when
:kind Supervisor. Held flat incrate::Caixaso the manifest stays a single typed form; this struct exists for validation + conversion.
Enums§
- Restart
Policy - Per-child restart policy.
- Restart
Strategy - One of the four canonical Erlang/OTP restart strategies.
- Supervisor
Error
Constants§
- SUPERVISOR_
MAX_ RESTARTS_ MAX - Upper-bound ceiling on the
:supervisor :max-restartsaxis — every validatedSupervisorSpec::max_restartspastSupervisorSpec::validatelies in1..=SUPERVISOR_MAX_RESTARTS_MAX. - SUPERVISOR_
RESTART_ WINDOW_ MAX - Upper-bound ceiling on the
:supervisor :restart-windowaxis — every validatedSome(SupervisorSpec::restart_window)pastSupervisorSpec::validatelies in1ms..=SUPERVISOR_RESTART_WINDOW_MAX(inclusive on both ends, integer-millisecond magnitudes by the canonical-form gate immediately preceding).
Functions§
- validate_
no_ self_ supervision - Cross-slot coherence gate on the supervision tree: no
:children :caixaentry may name the supervisor’s own:nome.