Mutex Map

5.20.0

Hierarchy (view full)

Constructors

Methods

  • wrap a function with semaphore, the different parameter will use different semaphore instance

    simply, it could be used as a deeply 'limit' function, after wrapping, the function will be limited by parameter values (by specific semaphore total count)

    Type Parameters

    • P extends any[]
    • T

    Parameters

    • runner: AsyncFunction<P, T>
    • extractor: ((args: P) => any) = DEFAULT_EXTRACTOR
        • (args): any
        • Parameters

          • args: P

          Returns any

    Returns AsyncFunction<P, T>