InMemorySnapshotRepository

In-memory implementation of SnapshotRepository for testing and development. Stores snapshots as JSON strings in a thread-safe map.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val name: String

The name of this repository.

Functions

Link copied to clipboard
open fun getVersion(aggregateId: AggregateId): Mono<Int>

Gets the version of the latest snapshot for the specified aggregate. Returns UNINITIALIZED_VERSION if no snapshot exists.

Link copied to clipboard
open override fun <S : Any> load(aggregateId: AggregateId): Mono<Snapshot<S>>

Loads a snapshot from the in-memory map by deserializing the JSON string.

Link copied to clipboard

Wraps a SnapshotRepository with metrics collection capabilities. Returns a MetricSnapshotRepository that collects metrics on snapshot storage operations.

Link copied to clipboard
open override fun <S : Any> save(snapshot: Snapshot<S>): Mono<Void>

Saves a snapshot to the in-memory map by serializing it to JSON.

Link copied to clipboard
open override fun scanAggregateId(namedAggregate: NamedAggregate, afterId: String, limit: Int): Flux<AggregateId>

Scans aggregate IDs from the in-memory map, sorted and filtered by afterId and limit.