mutex.d.ts 391 B

12345
  1. /**
  2. * Executes only one instance of give code at a time. For parallel calls, it
  3. * returns the result of the ongoing execution.
  4. */
  5. export declare function mutex<This, Args extends any[], Return>(fn: (this: This, ...args: Args) => Promise<Return>, context?: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Promise<Return>>): (this: This, ...args: Args) => Promise<Return>;