Skip to content

Gate

Defined in: core/src/gate.ts:36

readonly held: number;

Defined in: core/src/gate.ts:40

How many slots are held right now.


readonly max: number;

Defined in: core/src/gate.ts:38

How many calls may hold a slot at once.


readonly waiting: number;

Defined in: core/src/gate.ts:42

How many calls are queued for a slot.

acquire(signal?): Promise<() => void>;

Defined in: core/src/gate.ts:49

Wait for a slot, first in, first out. Resolves to its release, which is safe to call more than once. The signal covers the whole life of the slot: an abort while waiting leaves the queue and rejects with signal.reason, and an abort while held releases it.

Parameter Type
signal? AbortSignal

Promise<() => void>