ETS-backed store with file persistence.
This is the default store adapter. It keeps data in an ETS table for fast access and persists to a file on disk using the versioned ExWapp store codec. Legacy ETF-backed files are migrated on first load.
Options
:path- File path for persistence. Defaults to~/.cache/ex_wapp/session.etf
Examples
# Use with default path
store = ExWapp.Store.Ets.new()
# Use with custom path
store = ExWapp.Store.Ets.new(path: "/var/lib/myapp/wa_session.etf")
# Store and retrieve data
:ok = ExWapp.Store.persist(store, %{user: "Alice"})
{:ok, %{user: "Alice"}} = ExWapp.Store.load(store)Implementation Notes
- A linked writer process owns the ETS tables and serializes mutations
- Top-level domains, Signal sessions, device cache, and messages are stored separately so an update does not copy or replace unrelated state
- Caller-owned batches coalesce sync mutations into one durable snapshot
- Message streams traverse the ordered message table lazily by JID and cursor
- Snapshot encoding runs in a short-lived process to release its large heap immediately after compression and I/O
- File is loaded on
new/1if it exists
Summary
Functions
Loads store data directly from a persisted file path.
Types
Functions
@spec load_path(Path.t()) :: {:ok, ExWapp.Store.data()} | {:error, term()}
Loads store data directly from a persisted file path.
This is useful for one-off reads, such as pairing handoff flows, where creating a full ETS-backed store instance would hide missing-file errors by defaulting to an empty map.
@spec load_signal_sessions(t()) :: ExWapp.Signal.SessionStore.t()