ElGraph.Checkpoint (ElGraph v0.3.0)

Copy Markdown View Source

체크포인트 스냅샷 (SPEC §3.5).

처음부터 동결되는 두 가지: version 필드(스키마 마이그레이션의 기반)와 pending writes(어댑터에 별도 저장 — ElGraph.Checkpointer.put_writes/4). 그래프 정의는 저장하지 않는다 — 재개 시 그래프는 항상 코드에서 재구성된다.

step은 "다음에 실행할 superstep"을 뜻한다. next: []는 실행 완료를 뜻한다. interrupted는 동적 인터럽트를 일으킨 노드(재개 시 nil로 처리됨), interrupts는 노드별 재개 주입 값(ElGraph.resume:resume)이다. interrupt_info는 인터럽트 발생 기록(%{node, payload})으로 재개 후에도 보존된다 — ElTrace가 "왜 멈췄나"를 보여주는 근거.

Summary

Functions

상태가 영속화 가능한지 깊이 검사한다 (SPEC §3.8).

Types

t()

@type t() :: %ElGraph.Checkpoint{
  interrupt_info: %{node: atom(), payload: term()} | nil,
  interrupted: atom() | nil,
  interrupts: %{required(atom()) => [term()]},
  next: [atom()],
  state: map(),
  step: non_neg_integer(),
  task_cache: %{required({atom(), term()}) => term()},
  thread_id: String.t(),
  version: pos_integer()
}

Functions

validate_serializable(term)

@spec validate_serializable(term()) :: :ok | {:error, {:not_serializable, term()}}

상태가 영속화 가능한지 깊이 검사한다 (SPEC §3.8).

pid/reference/port/로컬 익명 함수는 재시작 후 재개 시 깨지므로 명시적 에러. 원격 캡처(&Mod.fun/2)는 허용한다.