/** * A counting semaphore, for capping concurrent outbound requests. * * Exists because a script's `Promise.all` over forty schedules would otherwise * open forty connections at once. handleApiError has a 429 branch, which is * evidence the API throttles, and code mode's first visible effect on a busy * site should not be rate-limit errors that classic mode never produced. * * FIFO rather than LIFO: a fan-out that starves its first request is a fan-out * whose slowest path is unbounded, and the invocation has a deadline. */ export interface Semaphore { /** Runs `work` once a slot is free, releasing the slot whether it resolves or throws. */ run(work: () => Promise): Promise; /** Slots currently held. Asserted on by the concurrency tests. */ readonly active: number; /** The high-water mark, so a test can prove the cap was never exceeded. */ readonly peak: number; } export declare function createSemaphore(limit: number): Semaphore; //# sourceMappingURL=semaphore.d.ts.map