Class IndexedEventStore<K, V>

A simple implementation of indexed EventStore backed by RangeQueryable MaybeAsyncMaps. In addition to topological ordering, it uses an atomic hybrid time to order concurrent events.

Type Parameters

Hierarchy

Implements

Constructors

Properties

currentEventDeps: [K, V][] = []

Cache of event parents during a put/validate operation.

data: AppendOnlyAutoKeyMap<K, V> & Partial<AutoKeyMapBatch<K, V>>
encodeKey: ((key) => string)

Type declaration

    • (key): string
    • Parameters

      • key: K

      Returns string

eventTypeSeparator: RegExp
getEventMeta: ((event) => undefined | EventMeta<K>) = ...

Type declaration

    • (event): undefined | EventMeta<K>
    • Returns given event metadata.

      Parameters

      • event: V

      Returns undefined | EventMeta<K>

index: MaybeAsyncMap<string, K> & Partial<MaybeAsyncMapBatch<string, K>> & RangeQueryable<string, K>
queryPageSize: number = DEFAULT_BATCH_SIZE
setEventTime: ((event, time) => V)

Type declaration

    • (event, time): V
    • Parameters

      • event: V
      • time: number

      Returns V

tick: ((refTime?) => MaybePromise<number>)

Type declaration

useCache: boolean = false

Set to true to use cache.

Methods

Generated using TypeDoc