pub enum RestartPolicy {
Permanent,
Transient,
Temporary,
}Expand description
A restart policy (R0.7 wave 2): how a supervised agent is restarted after a failed turn, in Erlang/OTP’s vocabulary because that vocabulary is the reference implementation of operational restart semantics.
“Restart” here means what the design doc defines it to mean: a new run on the agent’s thread, restoring the latest checkpoint — the mailbox is untouched, so the crashed turn’s message returns to visibility at its own lease expiry and is re-delivered under its idempotency key. State loss is bounded and explicit (the in-flight turn re-executes from its start; everything checkpointed survives), unlike OTP’s process restart, because the state is the checkpoint log, not the process.
Variants§
Permanent
Always restarted after a failed turn (within the declared intensity/period budget).
Transient
Restarted only after an abnormal termination. A turn cancelled by
clock (deadline) or by the cancellation tree is control flow, not a
crash — OTP’s transient rule applied to the R0.6
ErrorClass::Cancelled semantics.
Temporary
Never restarted after a failure: the first failed turn escalates.