# JobQueueWorker.onPop() method · @imqueue/job

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

Registers the handler called for each job popped from this queue.

**Signature:**

```typescript
onPop(handler: JobQueuePopHandler<T>): JobQueueWorker<T>;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| handler | [JobQueuePopHandler](https://imqueue.org/api/job/latest/job.jobqueuepophandler/)<T> | what to do with each job; its return value re-schedules |


**Returns:**

[JobQueueWorker](https://imqueue.org/api/job/latest/job.jobqueueworker/)<T>

this queue, for chaining

## Remarks

Replaces any handler already registered rather than adding to it — there is one handler per worker, and the last call wins. Nothing is delivered until [BaseJobQueue.start()](https://imqueue.org/api/job/latest/job.basejobqueue.start/) has been called, so registering the handler first and starting second is the order that cannot drop a job.

A message that is not an object — `null`, `undefined` or a bare primitive, none of which this package produces — is logged as invalid and dropped without reaching the handler, so the handler can assume it is being given a job rather than having to guard for one.

See [JobQueuePopHandler](https://imqueue.org/api/job/latest/job.jobqueuepophandler/) for what the handler's return value does, which is where this queue's retry behaviour is decided.

