# BaseJobQueue class · @imqueue/job

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

Shared base of the three concrete queues, implementing everything that does not depend on which end of the queue you are.

**Signature:**

```typescript
export declare abstract class BaseJobQueue<T, U> implements AnyJobQueue<T> 
```
**Implements:** [AnyJobQueue](https://imqueue.org/api/job/latest/job.anyjobqueue/)<T>

## Remarks

Not usable on its own and not meant to be subclassed outside this package: it leaves [BaseJobQueue.imq](https://imqueue.org/api/job/latest/job.basejobqueue.imq/) to be assigned by a subclass constructor, so a subclass that forgets to do so fails on first use. Reach for [JobQueue](https://imqueue.org/api/job/latest/job.jobqueue/), [JobQueueWorker](https://imqueue.org/api/job/latest/job.jobqueueworker/) or [JobQueuePublisher](https://imqueue.org/api/job/latest/job.jobqueuepublisher/) instead.

`T` is the concrete queue type, so inherited methods resolve to it rather than to this base; `U` is the job body type.

## Constructors


| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(options)](https://imqueue.org/api/job/latest/job.basejobqueue._constructor_/) | `protected` | Stores the options and resolves the logger, leaving the broker connection to the subclass. |


## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [handler?](https://imqueue.org/api/job/latest/job.basejobqueue.handler/) | `protected` | [JobQueuePopHandler](https://imqueue.org/api/job/latest/job.jobqueuepophandler/)<U> | _(Optional)_ The handler registered by `onPop`, if any. |
| [imq](https://imqueue.org/api/job/latest/job.basejobqueue.imq/) | `protected` | IMessageQueue | The underlying `@imqueue/core` message queue this job queue runs on. |
| [logger](https://imqueue.org/api/job/latest/job.basejobqueue.logger/) | `readonly` | ILogger | Logger this queue reports through — [JobQueueOptions.logger](https://imqueue.org/api/job/latest/job.jobqueueoptions.logger/) when one was given, `console` otherwise. |
| [name](https://imqueue.org/api/job/latest/job.basejobqueue.name/) | `readonly` | string | Name of this queue, as given in [JobQueueOptions.name](https://imqueue.org/api/job/latest/job.jobqueueoptions.name/). |
| [options](https://imqueue.org/api/job/latest/job.basejobqueue.options/) | `protected` | [JobQueueOptions](https://imqueue.org/api/job/latest/job.jobqueueoptions/) | The options this queue was constructed with, kept so that accessors like [BaseJobQueue.name](https://imqueue.org/api/job/latest/job.basejobqueue.name/) can read them back. Treat as read-only — nothing re-reads them after the broker connection is made, so changing one here has no effect on a running queue. |


## Methods


| Method | Modifiers | Description |
| --- | --- | --- |
| [destroy()](https://imqueue.org/api/job/latest/job.basejobqueue.destroy/) |  | Destroys the job queue, closing the broker connection and releasing its resources. Not reversible — construct a new queue to carry on. |
| [start()](https://imqueue.org/api/job/latest/job.basejobqueue.start/) |  | Starts processing the job queue. |
| [stop()](https://imqueue.org/api/job/latest/job.basejobqueue.stop/) |  | Stops processing the job queue, leaving it able to start again. |

