saga/storage/file

Stores executions’ checkpoints as files in one directory, so a durable run can be recovered in a fresh VM.

Use this adapter when a saga/durable run must survive VM shutdown and one VM at a time uses the directory. Each execution is one file, named after its id; a write goes to a synced temporary file that is then atomically renamed over it. A claim lasts while the claiming process lives in this VM; a file written by an earlier VM is unowned, so a fresh VM can resume it at once. The directory must be a canonical absolute path, and the caller creates it. Concurrent VMs, path aliases and power-loss durability of the directory are unsupported; use the saga_postgres package to share executions across VMs.

import saga/storage/file

let storage = file.open("/var/lib/shop/checkouts")

Values

pub fn open(directory: String) -> storage.Storage

Returns the Storage for the executions saved in directory. Opening does no I/O; each operation reads or writes one file.

✨ Search Document