Skip to main content

Module es_stack

Module es_stack 

Source
Expand description

Shared assembly of the event-sourced stack — EventStore, in-process EventBus, ReadModelStore, ProjectionEngine, and CommandBus.

Generic over the domain aggregate A: the framework never names a concrete aggregate. Applications supply A and their projectors; the runtime server (commands::serve) and CLI utilities drive the same wiring.

Structs§

EsStack
Bundle of constructed components — the parts external code keeps a handle on after wiring.
EsStores
Boxed storage seam shared by every entry point. The command bus and the projection engine each own an independent handle to the same backend so the write path and replay path do not contend on one connection wrapper.

Functions§

apply_snapshot_policy
Apply a snapshot policy to a command bus if one is configured.
build
Build the in-process stack for the configured driver, registering the supplied projectors against the in-process bus so writes drive their views synchronously. Used by CLI utilities (migrate --seed, seed) and tests.
build_stores
Construct the event store and read-model store for the selected driver. Domain code never sees the concrete type — only Box<dyn EventStore> and Arc<dyn ReadModelStore>.