interface IJob
Since 0.1.0

A queued job delivered to a processor.

Type Parameters

T = unknown

The job payload type

Properties

readonly
id: string

Queue-assigned job ID.

readonly
name: string

The job name it was enqueued under.

readonly
data: T

The job payload.

readonly
attempts: number

How many times this job has been attempted (1 on first delivery).

Since 0.5.0
readonly
optional
headers: Readonly<Record<string, string>>

Transport headers carried with the job, mirroring MessageMetadata.headers so the two ingresses cannot drift on meaning: {} means the channel was read and carried nothing; absent means there was no channel.

This is the queue's half of trace propagation. A framework with a CAPABILITIES.TELEMETRY provider writes a W3C traceparent here when the job is enqueued, so the processor's work joins the trace of the request that caused it; without one, the map holds only what the caller passed in AddJobOptions.headers.

Absent is a real answer and never substituted with {}: an IQueue implementation whose transport cannot carry a header omits the member rather than reporting an empty one, so "this queue has no channel" stays distinguishable from "the channel was empty".

Usage

import { type IJob } from "queue-plugin/src/index.ts";