Optional in-memory fast path for live-session lookup.
Stores the latest known live session per {workspace_id, visitor_id} in a
public ETS table. The DB remains authoritative; this cache is only a read
optimization for callers that can safely confirm cached sessions.
Summary
Functions
Clears every entry.
Invalidate one key.
Creates the ETS table if it does not exist. Idempotent.
Returns {:ok, entry} or :miss.
Write-through put.
Functions
@spec clear() :: :ok
Clears every entry.
@spec delete(Ecto.UUID.t(), Ecto.UUID.t()) :: :ok
Invalidate one key.
@spec ensure_table() :: :ok
Creates the ETS table if it does not exist. Idempotent.
@spec get(Ecto.UUID.t(), Ecto.UUID.t()) :: {:ok, map()} | :miss
Returns {:ok, entry} or :miss.
@spec put(Ecto.UUID.t(), Ecto.UUID.t(), map()) :: :ok
Write-through put.