Member Junction
    Preparing search index...
    • Run tasks with at most limit executing concurrently, preserving input order in the returned results.

      When options.shouldStop is supplied it is evaluated by each worker before it claims its next task; once it returns true no further tasks are dispatched (in-flight tasks still complete) and their slots stay undefined.

      Type Parameters

      • T

        the task result type

      Parameters

      • tasks: (() => Promise<T>)[]

        the task thunks to run

      • limit: number

        the maximum number in flight (coerced to ≥ 1)

      • options: RunBoundedOptions = {}

        optional controls (e.g. a shouldStop budget predicate)

      Returns Promise<T[]>

      the results in the same order as tasks (undefined for un-dispatched slots)