Package-level declarations

Types

Link copied to clipboard
sealed interface ConfirmOutcome
Link copied to clipboard
class Reservation @InternalWowApi constructor(val scope: ReservationScope, val key: String, val owner: AggregateRef, val expiresAt: Long?, val holds: Set<String> = emptySet(), val version: Int = ReservationStore.UNVERSIONED)

owner's reservation of key in scope. A pending reservation expires at expiresAt (epoch milliseconds) and is held by the attempts in holds; a confirmed one has no expiry and no holds, and version is the version of the owner's fact that last confirmed it (ReservationStore.UNVERSIONED for a pending one). Its owner is an aggregate of the scope's type.

Link copied to clipboard
class ReservationKey @InternalWowApi constructor(val namespace: String, val key: String, val system: Boolean = false)

A reserved or released key in namespace, without its owner or expiry: what an append records. Its scope follows from the entry's aggregate (ReservationScope.of): its type and its tenant, or no tenant when the key is a system one, unique across tenants.

Link copied to clipboard
class ReservationScope @InternalWowApi constructor(val type: AggregateType, val tenantId: String, val namespace: String)

Where a reserved key is unique: the aggregate type of its owners (within the type, not the bounded context), the tenantId (axiom A6: every unique key includes the tenant) and the namespace, such as user.name. A key unique across the type's tenants has the tenant SYSTEM_TENANT, which no aggregate's tenant ever is. The scope names the type, not only its owner, because some reads have no owner: ReservationStore.find looks a key up.

Link copied to clipboard

Reserved keys: uniqueness across aggregate instances, such as a user name unique within a tenant (documentation/designs/01-programming-model.md §7; 9.x PrepareKey).