Arc.Chronicle (cratis_arc v0.1.0)

Copy Markdown View Source

Appends the events a command returned to Chronicle.

Events are grouped by event source id, in the order returned, and each group is appended atomically (Chronicle.append_with_result/3 for one event, append_many_with_result/3 for several). Constraint and concurrency violations become validation results ("constraintViolation", "concurrencyViolation") so a client can show them like any other rejection.

Summary

Functions

Appends events for a command whose key is default_source.

Functions

append(events, default_source, ctx)

@spec append(term(), String.t() | nil, Arc.Context.t()) ::
  :ok | {:error, [Arc.ValidationResult.t()]}

Appends events for a command whose key is default_source.

Returns :ok or {:error, results}.