concurrencyDecorator.d.ts 494 B

123456
  1. /**
  2. * A class method decorator that limits the concurrency of the method to the
  3. * given number of parallel executions. All invocations are queued and executed
  4. * in the order they were called.
  5. */
  6. export declare function concurrency<This, Args extends any[], Return>(limit: number): (fn: (this: This, ...args: Args) => Promise<Return>, context?: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Promise<Return>> | undefined) => (this: This, ...args: Args) => Promise<Return>;