Jido.Bus.RecordedSignal (Jido v1.1.0-rc.1)

View Source

RecordedSignal Helper struct to store recorded signal metadata

Summary

Functions

Enrich the signal's metadata with fields from the RecordedSignal struct and any additional metadata passed as an option.

Map a list of Jido.Bus.RecordedSignal structs to their signal data.

Types

causation_id()

@type causation_id() :: uuid() | nil

correlation_id()

@type correlation_id() :: uuid() | nil

created_at()

@type created_at() :: DateTime.t()

data()

@type data() :: domain_signal()

domain_signal()

@type domain_signal() :: struct()

enriched_metadata()

@type enriched_metadata() :: %{
  :signal_id => signal_id(),
  :signal_number => signal_number(),
  :stream_id => stream_id(),
  :stream_version => stream_version(),
  :correlation_id => correlation_id(),
  :causation_id => causation_id(),
  :created_at => created_at(),
  optional(atom()) => term(),
  optional(String.t()) => term()
}

jido_metadata()

@type jido_metadata() :: map()

signal()

@type signal() :: struct()

signal_id()

@type signal_id() :: uuid()

signal_number()

@type signal_number() :: non_neg_integer()

stream_id()

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

stream_version()

@type stream_version() :: non_neg_integer()

t()

@type t() :: %Jido.Bus.RecordedSignal{
  causation_id: causation_id(),
  correlation_id: correlation_id(),
  created_at: created_at(),
  data: data(),
  jido_metadata: jido_metadata(),
  signal_id: signal_id(),
  signal_number: signal_number(),
  stream_id: stream_id(),
  stream_version: stream_version(),
  type: type()
}

type()

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

uuid()

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

Functions

enrich_metadata(signal, opts)

@spec enrich_metadata(t(), [{:additional_metadata, map()}]) :: enriched_metadata()

Enrich the signal's metadata with fields from the RecordedSignal struct and any additional metadata passed as an option.

map_from_recorded_signal(recorded_signal)

@spec map_from_recorded_signal(t()) :: signal()

Map an Jido.Bus.RecordedSignal struct to its signal data.

map_from_recorded_signals(recorded_signals)

@spec map_from_recorded_signals([t()]) :: [signal()]

Map a list of Jido.Bus.RecordedSignal structs to their signal data.