# JobQueueWorker class · @imqueue/job

Source: https://imqueue.org/api/job/latest/job.jobqueueworker/
Published: 2026-07-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/job 3.0.3 — generated reference, not hand-written

The consuming end of a job queue: handles jobs and never pushes them.

Use this in the processes that do the work, paired with a [JobQueuePublisher](https://imqueue.org/api/job/latest/job.jobqueuepublisher/) constructed with the same [JobQueueOptions.name](https://imqueue.org/api/job/latest/job.jobqueueoptions.name/). Run as many as you like — each job goes to one of them, which is how this scales out. It opens a worker-mode connection only, so it cannot enqueue jobs even by accident.

**Signature:**

```typescript
export declare class JobQueueWorker<T> extends BaseJobQueue<JobQueueWorker<T>, T> implements AnyJobQueueWorker<JobQueueWorker<T>, T> 
```
**Extends:** [BaseJobQueue](https://imqueue.org/api/job/latest/job.basejobqueue/)<[JobQueueWorker](https://imqueue.org/api/job/latest/job.jobqueueworker/)<T>, T>

**Implements:** [AnyJobQueueWorker](https://imqueue.org/api/job/latest/job.anyjobqueueworker/)<[JobQueueWorker](https://imqueue.org/api/job/latest/job.jobqueueworker/)<T>, T>

## Example


```typescript
import { JobQueueWorker } from '@imqueue/job';

const worker = new JobQueueWorker<Email>({ name: 'Email' });

worker.onPop(async (email: Email) => {
    await send(email);
});

await worker.start();
```

## Constructors


| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(options)](https://imqueue.org/api/job/latest/job.jobqueueworker._constructor_/) |  | Creates a worker-mode queue over the named job queue. |


## Methods


| Method | Modifiers | Description |
| --- | --- | --- |
| [onPop(handler)](https://imqueue.org/api/job/latest/job.jobqueueworker.onpop/) |  | Registers the handler called for each job popped from this queue. |

