ExESDB.Commanded.Adapter (ex_esdb v0.0.8-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.

Streams events from the given stream, in the order in which they were originally written.

Types

adapter_meta()

@type adapter_meta() :: map()

application()

@type application() :: Commanded.Application.t()

config()

@type config() :: Keyword.t()

error()

@type error() :: term()

expected_version()

@type expected_version() ::
  :any_version | :no_stream | :stream_exists | non_neg_integer()

source_uuid()

@type source_uuid() :: String.t()

start_from()

@type start_from() :: :origin | :current | integer()

stream_uuid()

@type stream_uuid() :: String.t()

subscriber()

@type subscriber() :: pid()

subscription()

@type subscription() :: any()

subscription_name()

@type subscription_name() :: String.t()

Functions

append_to_stream(adapter_meta, stream_uuid, expected_version, events, opts)

@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, error()}

Append one or more events to a stream atomically.

child_spec(application, opts)

Return a child spec defining all processes required by the event store.

stream_forward(adapter_meta, stream_uuid, start_version, read_batch_size)

@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.