ExESDB.Commanded.Adapter (ex_esdb v0.0.10-alpha)
An adapter for Commanded to use ExESDB as the event store. for reference, see: https://hexdocs.pm/commanded/Commanded.EventStore.Adapter.html
Summary
Functions
Append one or more events to a stream atomically.
Return a child spec defining all processes required by the event store.
Delete a snapshot of the current state of the event store.
Delete a subscription.
Record a snapshot of the current state of the event store.
Streams events from the given stream, in the order in which they were originally written.
Create a transient subscription to a single event stream.
Create a persistent subscription to an event stream.
Types
@type adapter_meta() :: map()
@type application() :: Commanded.Application.t()
@type config() :: Keyword.t()
@type error() :: term()
@type expected_version() :: :any_version | :no_stream | :stream_exists | non_neg_integer()
@type source_uuid() :: String.t()
@type start_from() :: :origin | :current | integer()
@type stream_uuid() :: String.t()
@type subscriber() :: pid()
@type subscription() :: any()
@type subscription_name() :: String.t()
Functions
@spec append_to_stream( adapter_meta :: map(), stream_uuid :: String.t(), expected_version :: integer(), events :: [Commanded.EventStore.EventData.t()], opts :: Keyword.t() ) :: :ok | {:error, :wrong_expected_version} | {:error, term()}
Append one or more events to a stream atomically.
@spec child_spec( application(), Keyword.t() ) :: {:ok, [:supervisor.child_spec() | {Module.t(), term()} | Module.t()], adapter_meta()}
Return a child spec defining all processes required by the event store.
@spec delete_snapshot( adapter_meta :: adapter_meta(), source_uuid :: source_uuid() ) :: :ok | {:error, error()}
Delete a snapshot of the current state of the event store.
@spec delete_subscription( adapter_meta :: adapter_meta(), selector :: stream_uuid(), subscription_name :: subscription_name() ) :: :ok | {:error, error()}
Delete a subscription.
@spec record_snapshot( adapter_meta :: adapter_meta(), snapshot_data :: any() ) :: :ok | {:error, error()}
Record a snapshot of the current state of the event store.
@spec stream_forward( adapter_meta :: adapter_meta(), stream_uuid :: stream_uuid(), start_version :: non_neg_integer(), read_batch_size :: non_neg_integer() ) :: Enumerable.t() | {:error, :stream_not_found} | {:error, error()}
Streams events from the given stream, in the order in which they were originally written.
@spec subscribe( adapter_meta :: adapter_meta(), stream :: String.t() ) :: :ok | {:error, error()}
Create a transient subscription to a single event stream.
The event store will publish any events appended to the given stream to the
subscriber
process as an {:events, events}
message.
The subscriber does not need to acknowledge receipt of the events.
@spec subscribe_to( adapter_meta :: adapter_meta(), stream :: String.t(), subscription_name :: String.t(), subscriber :: pid(), start_from :: :origin | :current | non_neg_integer(), opts :: Keyword.t() ) :: {:ok, subscription()} | {:error, :subscription_already_exists} | {:error, error()}
Create a persistent subscription to an event stream.