CommittedStates

The committed states a node reads: the latest committed state of an aggregate, as the write side keeps it (:runtime's state reads, injected here so that :query does not depend on the runtime).

Each answer's tree belongs to the read it is given to, which may mask it in place (ReadFacade.admitted): an implementation that keeps the instance it answers hands a copy.

Types

Link copied to clipboard

Functions

Link copied to clipboard
open suspend fun caughtUp(ref: AggregateRef): Snapshot<JsonNode>?

ref's latest committed state caught up with its log once, without waiting: null when it has no snapshot to catch up from (its latest state is then its log already), and by default. A catch-up longer than the node replays is InvalidStateReadException with the violation replay-too-long.

Link copied to clipboard
abstract suspend fun committed(ref: AggregateRef): Snapshot<JsonNode>?

ref's latest committed state, or null when it has none.

open suspend fun committed(ref: AggregateRef, minVersion: Int): Snapshot<JsonNode>?

ref's latest committed state at version minVersion or later, waited for a bounded time: the state read last, below minVersion when the wait ran out, or null when it has none. By default the latest one as it is; the runtime's catches a lagging snapshot up and waits. A catch-up longer than the node replays is InvalidStateReadException with the violation replay-too-long.