state

abstract suspend fun state(ref: AggregateRef): Snapshot<S>?

The latest committed state of the aggregate ref (its snapshot, else its log before the first one), as the public port's state read reads it: null when there is none or the reader may not see it, alike, and for a caller when ref is outside its tenant. Trusted code reads any tenant's.

Throws

when ref is not an aggregate of type.


abstract suspend fun state(ref: AggregateRef, minVersion: Int): Snapshot<S>?

The committed state of the aggregate ref at version minVersion or later (read your writes, me.ahoo.wow.api.result.CommandResult.version the version a command wrote): the latest state, its snapshot caught up with its log when the snapshot lags; null when the reader may not see it.

Throws

when the aggregate stays below minVersion through the read's wait (wow.query.state.min-version-wait): the command has not committed yet.