NewDash

    high level SemaphoreMap

    5.18.0

    Hierarchy (View Summary)

    Index

    Constructors

    • SemaphoreMap, provision semaphore with giving key

      Parameters

      • maximumSemObjects: number = ...

        maximumSemObjects to avoid OOM, the default value is 1000000

      • defaultSemCount: number = 10

        default sem permit number, the default value is 10

      Returns SemaphoreMap

    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

      Returns AsyncFunction<P, T>

    MMNEPVFCICPMFPCPTTAAATR