class

Arcana::LocalFileBackend

Inherits Arcana::StateBackend < Reference < Object

Persists state to a single file on the local filesystem. Atomic writes via tmp + rename (POSIX-atomic on the same filesystem).

Constructors

new(path : String)
Source

Instance methods

exists?

Has anything been saved yet?

Source
load

Return the most recent saved payload, or nil if nothing has ever been saved.

Source
path
Source
save(payload : String) : Nil

Persist the given payload (typically a JSON string). Must be atomic — a crash mid-save should leave the prior state intact, not a torn or empty file.

Source