Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PromiseQueue

Index

Constructors

  • new PromiseQueue(__namedParameters?: { concurrency?: number }): PromiseQueue
  • Parameters

    • __namedParameters: { concurrency?: number } = {}
      • Optional concurrency?: number

        The number of tasks that will be executed concurrently. Note that if concurrency > 1, the queue cannot guarantee FIFO since the tasks' execution times may vary.

    Returns PromiseQueue

Methods

  • addTask<T>(priority: number, task: () => Promise<T>): Promise<T>
  • Add a prioritized task to the queue. Note that a lower priority number means that the task will be prioritized. Ie.: 0 is the highest priority value.

    Type parameters

    • T

    Parameters

    • priority: number
    • task: () => Promise<T>
        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<T>

  • getInflight(): number
  • getSize(): number
  • isPaused(): boolean
  • pause(): void
  • resume(): void