Expand description
CQRS + Event Sourcing pattern.
CqrsPattern wires up the four moving parts of a typical
command-query stack:
- A command gateway actor that owns one
crate::AggregateRootinstance per aggregate id and persists events through the configuredatomr_persistence::Journal. - A repository handle that callers use to dispatch commands.
- Zero or more readers — async tasks that follow the
atomr_persistence_query::ReadJournal, decode events with the user-supplied codec, and fold them into projection state. - Extension hooks — pre-handler interceptors (validation,
authorization), post-persist event listeners, and async event
taps that bridge to
atomr_streams/ external systems.
See CqrsPattern::builder for the entry point.
Re-exports§
pub use audit::AuditLog;pub use audit::AuditProjection;
Modules§
- audit
AuditLog— built-insuper::Readerthat retains a ring of every event it sees, useful for compliance views and “what happened recently” UIs.
Structs§
- Cqrs
Builder - Fluent builder for a CQRS instance.
- Cqrs
Handles - Strongly-typed handles into a materialized CQRS instance.
- Cqrs
Pattern - Public, zero-sized handle to the CQRS pattern. Use
CqrsPattern::builderto start configuring an instance. - Cqrs
Topology - Inspectable description of a CQRS topology — actors not yet spawned,
readers not yet running. Call
Topology::materializeto bring it to life. - Event
Codec Registry - Manifest -> decoder map plus an optional catch-all decoder.
- Projection
Handle - Read-only access to a projection’s current state and offset.
Enums§
- Reader
Filter - What stream of events the reader subscribes to. Selected via
Reader::filter; defaults toReaderFilter::All.
Traits§
- Reader
- Fold journal events into a projection.
Functions§
- schedule_
command - Send
cmdtorepoafterdelay. Returns immediately; the dispatch happens in a detached tokio task. Errors from the repo are logged atwarnlevel — callers who care about the outcome should construct their own scheduling.