Raxol.Workflow.Checkpoint.Saver.Ets (Raxol v2.6.0)

View Source

ETS-backed Raxol.Workflow.Checkpoint.Saver adapter.

Stores checkpoints in a named ETS table created lazily on the first call. The table is :public and :ordered_set keyed by {thread_id, step} so iteration is naturally newest-first when we walk backwards.

Config

%{table: :my_workflow_checkpoints}

Defaults to :raxol_workflow_checkpoints when the :table key is absent. Two compiled graphs sharing the same table name will see each other's checkpoints; isolate them by passing distinct table names if that is undesirable.

Lifetime

The table lives for the duration of the BEAM. It is not supervised and does not survive Application.stop/1. Use the Dets adapter when checkpoints must outlive the BEAM.

Not for concurrent multi-writer use

ETS is concurrent-safe for the operations performed here, but the adapter does not provide cross-call atomicity (e.g. two callers racing to write step N may both succeed; the second put/3 is a no-op because the keys collide). The append-only contract guarantees the first writer wins.

Summary

Functions

Ensure the configured ETS table exists. Idempotent.

Functions

ensure_table(config)

@spec ensure_table(map()) :: atom()

Ensure the configured ETS table exists. Idempotent.