Gate
Defined in: core/src/gate.ts:36
Properties
Section titled “Properties”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.
waiting
Section titled “waiting”readonly waiting: number;Defined in: core/src/gate.ts:42
How many calls are queued for a slot.
Methods
Section titled “Methods”acquire()
Section titled “acquire()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
signal? |
AbortSignal |
Returns
Section titled “Returns”Promise<() => void>