Creates an execution pool for asynchronous functions with a limited concurrency.

  • Type Parameters

    • T extends unknown = any

      The type of the result of the wrapped function.

    • P extends any[] = any[]

      The types of the parameters of the wrapped function.

    Parameters

    • run: (...args: P) => Promise<T>

      The function to be executed in the pool.

    • Optionaloptions: Partial<IConfig>

      Optional configuration options for the execution pool.

    Returns IWrappedFn<T, P>

    A wrapped function that executes asynchronously within the execution pool.