export interface ConcurrencyGate { enter: () => Promise; exit: (id: number) => void; use: (func: () => Promise) => Promise; } /** * Prevents too many async functoins from running at the same time. * You can use this typically in combination with `Promise.all`. * See the tests for examples. * @param maxConcurrency The number of functions that can enter * the "gate" at the same time. */ declare const concurrencyGate: (maxConcurrency: number) => ConcurrencyGate; export default concurrencyGate;