mem_evoq_adapter (mem_evoq v0.1.2)

View Source

Adapter module implementing both the evoq_event_store surface and the evoq_snapshot_adapter behaviour.

Configured into evoq via:

  application:set_env(evoq, event_store_adapter, mem_evoq_adapter),
  application:set_env(evoq, snapshot_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.

Note that two seams cross this module: read paths translate #event{} to #evoq_event{} before returning; snapshot reads translate #snapshot{} to #evoq_snapshot{}. mac, signature and anchor_hash are intentionally NOT propagated — they are storage- layer concerns.

Summary

Functions

append(StoreId, StreamId, ExpectedVersion, Events)

delete(StoreId, StreamId)

delete_at_version(StoreId, StreamId, Version)

delete_stream(StoreId, StreamId)

exists(StoreId, StreamId)

has_events(StoreId)

list_streams(StoreId)

list_versions(StoreId, StreamId)

read(StoreId, StreamId)

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_at_version(StoreId, StreamId, Version)

read_by_event_types(StoreId, EventTypes, BatchSize)

read_by_tags(StoreId, Tags, BatchSize)

read_by_tags(StoreId, Tags, Match, BatchSize)

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

subscribe(StoreId, StreamId, Pid, Opts)

subscribe_all(StoreId, Pid, Opts)

unsubscribe(StoreId, SubKey)

version(StoreId, StreamId)