Class InMemoryEventStore

Events in memory, numbered per run and deduplicated by id: for tests, single-process hosts and runs that are not kept. Events are copied in and out, payloads included, so a caller never holds a stored event.

Implements

Constructors

Methods

  • Optional whole-run eviction for in-memory hosts after terminal cleanup and the retention grace. Durable stores omit it to retain their records. Call only after producers have stopped; forgetting removes fences too.

    Parameters

    • runId: string

    Returns Promise<void>

  • Inserts with the next sequence number of the run; a repeated eventId is not inserted and answers the existing sequence. Behind the fence a content event is stored without its payload, marked purged.

    Parameters

    Returns Promise<{
        inserted: boolean;
        seq: number;
    }>