JobQueuePublisher class
The producing end of a job queue: pushes jobs and never handles them.
Use this in the process that creates work — an API, a scheduler, a webhook receiver — and pair it with a JobQueueWorker constructed with the same JobQueueOptions.name. It opens a publisher-mode connection only, so it cannot receive jobs even by accident.
Signature:
export declare class JobQueuePublisher<T> extends BaseJobQueue<JobQueuePublisher<T>, T> implements AnyJobQueuePublisher<JobQueuePublisher<T>, T>
Extends: BaseJobQueue<JobQueuePublisher<T>, T>
Implements: AnyJobQueuePublisher<JobQueuePublisher<T>, T>
Example
import { JobQueuePublisher } from '@imqueue/job';
const publisher = new JobQueuePublisher<Email>({ name: 'Email' });
publisher.push({ to: 'a@b.c', subject: 'Hi' });
publisher.push({ to: 'a@b.c', subject: 'Tomorrow' }, { delay: 86400000 });
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Creates a publisher-mode queue over the named job queue. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Enqueues one job, optionally delayed or time-limited. |
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.