commanded v0.10.0 Commanded.EventStore behaviour
Defines the behaviour to be implemented by an event store adapter to be used by Commanded.
Summary
Callbacks
Acknowledge receipt and successful processing of the given event received from a subscription to an event stream
Append one or more events to a stream atomically
Delete a previously recorded snapshop for a given source
Read a snapshot, if available, for a given source
Record a snapshot of the data and metadata for a given source
Streams events from the given stream, in the order in which they were originally written
Subscriber will be notified of every event persisted to any stream
Unsubscribe an existing subscriber from all event notifications
Types
Callbacks
Acknowledge receipt and successful processing of the given event received from a subscription to an event stream.
append_to_stream(stream_uuid, expected_version :: non_neg_integer, events :: [Commanded.EventStore.EventData.t]) :: {:ok, stream_version} | {:error, reason}
Append one or more events to a stream atomically.
Delete a previously recorded snapshop for a given source
read_snapshot(source_uuid) :: {:ok, snapshot} | {:error, :snapshot_not_found}
Read a snapshot, if available, for a given source.
Record a snapshot of the data and metadata for a given source
stream_forward(stream_uuid, start_version :: non_neg_integer, read_batch_size :: non_neg_integer) :: Enumerable.t | {:error, reason}
Streams events from the given stream, in the order in which they were originally written.
subscribe_to_all_streams(subscription_name, subscriber :: pid, start_from) :: {:ok, subscription :: pid} | {:error, :subscription_already_exists} | {:error, reason}
Subscriber will be notified of every event persisted to any stream.
unsubscribe_from_all_streams(subscription_name) :: :ok
Unsubscribe an existing subscriber from all event notifications.