Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of a worker queue data structure

Type parameters

  • T

    the task element

  • V = unknown

    the worker value

Hierarchy

Index

Constructors

Properties

Tasks: Tasks<Task<T, unknown>>

Type: a queue of tasks

activeWorkers: number = 0

Number of active workers

concurrency: number

The maximum number of concurrent workers

createTasks: CreateInnerQueue<Tasks<Task<T, unknown>>> = ...

Returns a new blank internal queue of tasks

refreshInterval: number

How often to update task statuses (in milliseconds)

tasks: Tasks<Task<T, unknown>>

A queue of tasks

worker: QueueWorker<T, V>

The worker constructor

Accessors

  • get length(): number

Methods

  • [asyncIterator](): AsyncIterableIterator<T>
  • [iterator](): IterableIterator<T>
  • clear(): void
  • deferPerform(): Promise<unknown>
  • perform(): void
  • push(task: T): Promise<V>
  • resolveTask(task: T, resolve: Function): void
  • start(): void
  • unshift(el: T): Promise<V>
  • values(): IterableIterator<T>