Class AbstractDatabasePoolClient<TPoolClient, TPayload>Abstract

Abstract class representing a database pool client.

Type Parameters

  • TPoolClient

    The type of the pool client.

  • TPayload

    The type of the job payload.

Constructors

Properties

client: TPoolClient

The underlying client instance.

queueName: string

The name of the queue.

Methods

  • Updates the state of a job by its ID.

    Parameters

    • id: number

      The ID of the job.

    • state: JobState

      The new state of the job.

    • Optional errorMessage: string

      An optional error message if the job failed.

    Returns Promise<Job<TPayload>>

    • The updated job.

    Abstract

    Example

    const job = await client.updateJobStateById(1, 'completed');