Durable append-only event log for agent sessions.
Agent sessions call record/3, which is a cast to this writer process, so session execution never waits on SQLite I/O. Readers open their own connections through open_read_connection/1 and query by cursor with events_after/4; WAL mode lets those reads proceed without blocking the writer.
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns the configured event-log database path.
Queries events for a session after the given cursor.
Returns the latest event id for a session.
Opens a read connection to the agent event database.
Records an agent event asynchronously.
Starts the event log writer.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Returns the configured event-log database path.
@spec events_after( MingaAgent.EventLog.Store.db(), String.t(), non_neg_integer(), pos_integer() ) :: {:ok, [MingaAgent.EventLog.EventRecord.t()]} | {:error, term()}
Queries events for a session after the given cursor.
@spec latest_id(MingaAgent.EventLog.Store.db(), String.t()) :: {:ok, non_neg_integer()} | {:error, term()}
Returns the latest event id for a session.
@spec open_read_connection(keyword()) :: {:ok, MingaAgent.EventLog.Store.db()} | {:error, term()}
Opens a read connection to the agent event database.
@spec record( String.t(), MingaAgent.EventLog.EventRecord.event_type(), map(), GenServer.server() ) :: :ok
Records an agent event asynchronously.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the event log writer.