disintegrate_postgres

Function decision_maker_with_snapshot

Source
pub async fn decision_maker_with_snapshot<E: Event + Send + Sync + Clone, S: Serde<E> + Clone + Sync + Send>(
    event_store: PgEventStore<E, S>,
    every: u64,
) -> Result<PgDecisionMaker<E, S, WithPgSnapshot>, Error>
Expand description

Creates a decision maker specialized for Postgres with snapshotting. The every parameter determines the frequency of snapshot creation, indicating the number of events between consecutive snapshots.

§Arguments

  • event_store: An instance of PgEventStore.
  • every: The frequency of snapshot creation, specified as the number of events between consecutive snapshots.

§Returns

A PgDecisionMaker with snapshotting configured using the provided snapshot frequency.