Persist work board, store, and events to disk.
Subscribes to PubSub and writes state to JSON files on change. On startup, loads saved state back into ETS tables so work survives IEx restarts.
Files
work.json-- full work board snapshotstore.json-- full store snapshotevents.jsonl-- append-only event log (one JSON object per line)
Configuration
configure(persistence: true) # use .agent_workshop/ in cwd
configure(persistence: "/path/to/dir") # custom directoryPersistence is disabled by default. When disabled, this GenServer is idle.
Summary
Functions
Returns a specification to start this module under a supervisor.
Disable persistence. Closes open file handles.
Enable persistence to the given directory.
Check if persistence is currently enabled.
Force an immediate flush of all pending writes.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec disable() :: :ok
Disable persistence. Closes open file handles.
Enable persistence to the given directory.
Pass true to use the default .agent_workshop/ in the current directory,
or a path string for a custom location.
@spec enabled?() :: boolean()
Check if persistence is currently enabled.
@spec flush() :: :ok
Force an immediate flush of all pending writes.