Skip to content

Interface: LockState

@roomful/core


@roomful/core / LockState

Defined in: packages/core/src/types.ts:1213

Describes the resolved state of a single advisory lock — who holds it (if anyone) and when the claim was made and expires.

Locks are EPHEMERAL (released on holder disconnect, TTL expiry, or explicit release) and ADVISORY (a coordination convention, not enforced mutual exclusion). Every peer resolves the holder independently and deterministically so the result converges, but see LockEngine for the consistency model and the brief races possible under simultaneous claims.

acquiredAt: number

Defined in: packages/core/src/types.ts:1229

Records when the holding claim was made, in epoch milliseconds. 0 when the lock is free.


expiresAt: number | null

Defined in: packages/core/src/types.ts:1236

Records when the holding claim self-expires, in epoch milliseconds, or null when the claim has no TTL (and only releases explicitly or on disconnect). null when the lock is free.


holder: Peer<PresenceData> | null

Defined in: packages/core/src/types.ts:1223

Identifies the peer that currently holds the lock, or null when the lock is free.


key: string

Defined in: packages/core/src/types.ts:1217

Identifies the lock.