Chronicle.EventSources.ConcurrencyDimensions (cratis_chronicle v3.16.1)

Copy Markdown View Source

The dimensions of an append that take part in its concurrency check.

Written as a list of atoms — :event_source_id, :event_source_type, :event_stream_type, :event_stream_id — or :none / [] for no dimensions. The wire representation is the flags value of the Chronicle ConcurrencyDimensions contract.

Summary

Functions

Normalizes dimensions given as atoms, a list of atoms, or a flags integer into a sorted list.

Returns the flags integer sent on the wire.

Types

dimension()

@type dimension() ::
  :event_source_id | :event_source_type | :event_stream_type | :event_stream_id

t()

@type t() :: [dimension()]

Functions

normalize(value)

@spec normalize(:none | dimension() | [dimension()] | non_neg_integer() | nil) :: t()

Normalizes dimensions given as atoms, a list of atoms, or a flags integer into a sorted list.

to_flags(value)

@spec to_flags(:none | dimension() | [dimension()] | non_neg_integer() | nil) ::
  non_neg_integer()

Returns the flags integer sent on the wire.