module

Keep::Checkpoint

A cache of the fold as of a version: {"version": N, "state": …}, written atomically. The application owns the state's shape; keep only owns the envelope, so a checkpoint always says which commit it is.

Class methods

read(path : Path | String) : Tuple(Int64, String) | Nil

The version and state JSON of a checkpoint, or nil if there's no file. Raises Error for a file that isn't a checkpoint (no version) — the application decides what a bare document means.

Source
write(path : Path | String, version : Int64, state_json : String) : Nil

Write state_json (any JSON value, already serialized) at version.

Source