eidetic v0.5.0 Eidetic.EventStore behaviour
This module manages loading / saving from / to the EventStore.
Configuring:
confing :eidetic eventstore_adapter: Some.Adapter
Using:
{:ok, aggregate} = Eidetic.save(an_aggregate)
# or
aggregate = Eidetic.save!(aggregate)
Link to this section Summary
Functions
Load events from the EventStore and produce an aggregate
Load events, to a particular version, from the EventStore and produce an aggregate
Load events from the EventStore and produce a aggregate, only returning the aggregate
Load events, to a particular version, from the EventStore and produce a aggregate, only returning the aggregate
Save an %Eidetic.Aggregate{}’s uncommitted events to the EventStore
Save an %Eidetic.Aggregate{}’s uncommitted events to the EventStore, only returning the aggregate
Link to this section Functions
Load events from the EventStore and produce an aggregate
Load events, to a particular version, from the EventStore and produce an aggregate
Load events from the EventStore and produce a aggregate, only returning the aggregate.
Load events, to a particular version, from the EventStore and produce a aggregate, only returning the aggregate.
Save an %Eidetic.Aggregate{}’s uncommitted events to the EventStore
Save an %Eidetic.Aggregate{}’s uncommitted events to the EventStore, only returning the aggregate.
Eventually this will raise an error when a write / transaction fails.
Link to this section Callbacks
handle_call({:fetch_until, String.t, pos_integer}, pid, Map) :: {:ok, [{:events, [%Eidetic.Event{datetime: term, identifier: term, metadata: term, payload: term, serial_number: term, type: term, version: term}]}]}
handle_call({:fetch, String.t}, pid, Map) :: {:ok, [{:events, [%Eidetic.Event{datetime: term, identifier: term, metadata: term, payload: term, serial_number: term, type: term, version: term}]}]}
handle_call({:record, %Eidetic.Event{datetime: term, identifier: term, metadata: term, payload: term, serial_number: term, type: term, version: term}}, pid, Map) :: {:ok, [{:object_identifier, String.t}]}