reserve

abstract suspend fun reserve(scope: ReservationScope, key: String, owner: AggregateRef, hold: String, ttl: Duration): Reservation?

Reserves key in scope for owner's attempt hold, pending for ttl. A key held by no one, or only by an expired pending reservation (whoever's), is taken: pending, its only hold hold. When owner holds the key pending and live, hold joins its holds and the later expiry is kept; when owner holds it confirmed, it stays as it is.

Return

the reservation owner now holds, or null when another owner's live reservation holds the key.