AshCommanded.Commanded.SnapshotConfiguration (AshCommanded v0.1.0)

View Source

Provides configuration options for Commanded to use AshCommanded's snapshot functionality.

This module standardizes snapshot configuration options for Commanded applications.

Summary

Functions

Returns the snapshot options to use when dispatching a command.

Returns the snapshot options to use when configuring a Commanded application.

Functions

dispatch_options()

@spec dispatch_options() :: Keyword.t()

Returns the snapshot options to use when dispatching a command.

Returns

A keyword list of snapshot options for command dispatch

Examples

iex> AshCommanded.Commanded.SnapshotConfiguration.dispatch_options()
[snapshot_module: AshCommanded.Commanded.SnapshotAdapter]

snapshot_options(threshold \\ 100)

@spec snapshot_options(integer() | nil) :: Keyword.t()

Returns the snapshot options to use when configuring a Commanded application.

Parameters

  • threshold - The number of events to process before taking a snapshot (default: 100)

Returns

A keyword list of snapshot options for Commanded

Examples

iex> AshCommanded.Commanded.SnapshotConfiguration.snapshot_options(500)
[snapshot_every: 500, snapshot_module: AshCommanded.Commanded.SnapshotAdapter]