factos/factos_pog/simulate
PostgreSQL-backed execution of application subscriptions during simulation.
Accepted simulated event batches run strong subscriptions in a PostgreSQL transaction. The event history remains in memory; only application-owned projection writes are committed to PostgreSQL.
Values
pub fn new(
model: factos.Model(command, state, event, domain_error),
with events: List(event),
connection connection: pog.Connection,
subscriptions subscriptions: List(
factos.Subscription(
pog.Connection,
factos.Recorded(event),
subscription_error,
),
),
) -> simulate.Simulation(
event,
command,
state,
domain_error,
subscription_error,
pog.QueryError,
)
Create a simulation with initial events and PostgreSQL subscriptions.
The initial event batch and every successful simulate.dispatch batch run in
their own transaction. Subscription or transaction failure leaves the batch
out of simulated history and is returned by simulate.errors.