mem_evoq_adapter (mem_evoq v0.1.1)

View Source

Adapter module implementing the evoq_event_store contract.

Configured into evoq via:

  application:set_env(evoq, event_store_adapter, mem_evoq_adapter).

Every callback looks up the store pid in mem_evoq_registry and forwards via gen_server:call/2. The store itself (mem_evoq_store) holds the actual state.

This module is the public stable surface. The store gen_server's callback contract may evolve internally; the adapter's exports must not change without bumping the package's major version.

Summary

Functions

append(StoreId, StreamId, ExpectedVersion, Events)

delete(StoreId, StreamId)

delete_snapshot(StoreId, StreamId)

exists(StoreId, StreamId)

has_events(StoreId)

list_snapshots(StoreId, StreamId)

list_streams(StoreId)

load_snapshot(StoreId, StreamId)

load_snapshot_at(StoreId, StreamId, Version)

read(StoreId, StreamId, FromVersion, Count, Direction)

read(StoreId, StreamId, FromVersion, Count, Direction, Opts)

read_all(StoreId, StreamId, Direction)

read_all(StoreId, StreamId, Direction, BatchSize)

read_all_global(StoreId, Offset, BatchSize)

read_by_event_types(StoreId, EventTypes, BatchSize)

read_by_tags(StoreId, Tags, BatchSize)

read_by_tags(StoreId, Tags, Match, BatchSize)

save_snapshot(StoreId, StreamId, Snapshot)

save_snapshot(StoreId, StreamId, Version, Data, Metadata)

subscribe(StoreId, StreamId, Pid, Opts)

subscribe_all(StoreId, Pid, Opts)

unsubscribe(StoreId, SubKey)

version(StoreId, StreamId)