LifecycleSlot
Defined in: packages/client/src/lifecycle-slot.ts:32
A single-occupancy lifecycle slot. One owner per store (createSyncClient); one operation at a time.
Properties
Section titled “Properties”isBusy
Section titled “isBusy”isBusy: () =>
boolean
Defined in: packages/client/src/lifecycle-slot.ts:42
Whether an operation currently holds the slot.
Returns
Section titled “Returns”boolean
run: <
T>(label,fn) =>Promise<T>
Defined in: packages/client/src/lifecycle-slot.ts:40
Run fn under the slot’s exclusion. Rejects with a LifecycleBusyError — without invoking fn
— if the slot is already occupied; otherwise holds the slot for fn’s lifetime and releases it in a
finally, so a throwing operation never leaves the slot stuck. The occupancy check + claim run
synchronously on entry (before the first await), so two calls issued in the same tick resolve
deterministically: the first claims, the second is refused.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
() => Promise<T>
Returns
Section titled “Returns”Promise<T>
runningLabel
Section titled “runningLabel”runningLabel: () =>
string|null
Defined in: packages/client/src/lifecycle-slot.ts:44
The label of the operation currently holding the slot, or null when free.
Returns
Section titled “Returns”string | null