Job queue which provides background processing by workers

Type Parameters

  • T extends Record<any, any>

Hierarchy

  • JobQueue

Implements

Constructors

Methods

  • Adds multiple jobs to the job queue

    Parameters

    • jobs: Job<T>[]

    Returns Promise<void>

  • Starts the job queue and adds workers for each job

    Parameters

    • workersByJob: Record<string, Worker<T>>
    • resumeActive: boolean = true

    Returns Promise<void>

  • Stops the job queue. Waits up to 30000 ms for active jobs to complete

    Returns Promise<void>

  • Updates the job data for a particular job

    Returns

    promise that resolves if the job was successfully updated

    Parameters

    • jobId: string

      id of the job

    • data: T

      data to update

    Returns Promise<void>