lightspeed/ops/supervision

Supervision tree guidance for production Lightspeed deployments.

Types

Child process guidance entry.

pub type ChildSpec {
  ChildSpec(
    id: String,
    module_name: String,
    restart: Restart,
    shutdown_ms: Int,
  )
}

Constructors

  • ChildSpec(
      id: String,
      module_name: String,
      restart: Restart,
      shutdown_ms: Int,
    )

Top-level supervision plan guidance.

pub type Plan {
  Plan(
    name: String,
    strategy: Strategy,
    children: List(ChildSpec),
  )
}

Constructors

Plan validation errors.

pub type PlanError {
  MissingRequiredChild(String)
  DuplicateChildId(String)
}

Constructors

  • MissingRequiredChild(String)
  • DuplicateChildId(String)

Restart behavior for a child process.

pub type Restart {
  Permanent
  Transient
  Temporary
}

Constructors

  • Permanent
  • Transient
  • Temporary

Supervision strategy.

pub type Strategy {
  OneForOne
  RestForOne
  OneForAll
}

Constructors

  • OneForOne
  • RestForOne
  • OneForAll

Values

pub fn child_ids(plan: Plan) -> List(String)

Child ids in declaration order.

pub fn default_plan(app_name: String) -> Plan

Build a default plan with recommended Phase 7 children.

pub fn restart_label(restart: Restart) -> String

Stable restart label.

pub fn strategy_label(strategy: Strategy) -> String

Stable plan label.

pub fn validate(plan: Plan) -> Result(Nil, PlanError)

Validate required child coverage and duplicate ids.

Search Document