Skip to main content

Class: InMemoryEventStore

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:240

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​

Constructor​

new InMemoryEventStore(): InMemoryEventStore

Returns​

InMemoryEventStore

Methods​

append()​

append(event): Promise<{ inserted: boolean; seq: number; }>

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:250

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​

event​

Omit<MeetingEvent, "seq">

Returns​

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

Implementation of​

IEventStore.append


fence()​

fence(runId): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:261

The fence: from now on no payload of a content event is stored for the run.

Parameters​

runId​

string

Returns​

Promise<void>

Implementation of​

IEventStore.fence


forget()​

forget(runId): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:241

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>

Implementation of​

IEventStore.forget


purgePayloads()​

purgePayloads(runId): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:267

Removes the payload of every content event of the run; type, time and sequence stay.

Parameters​

runId​

string

Returns​

Promise<void>

Implementation of​

IEventStore.purgePayloads


read()​

read(runId, fromSeq, limit?): Promise<MeetingEvent[]>

Defined in: packages/agentos/src/io/channels/meetings/stores/memory.ts:264

The run's events after fromSeq, in sequence order, at most limit of them.

Parameters​

runId​

string

fromSeq​

number

limit?​

number = 500

Returns​

Promise<MeetingEvent[]>

Implementation of​

IEventStore.read