Interface QueueHandle
name: string;
clean(
graceMs: number,
limit: number,
state: "completed" | "failed" | "cancelled",
): Promise<number>;
enqueue(
kind: string,
payload: unknown,
options?: QueueEnqueueOptions,
): Promise<EnqueueOutcome>;
enqueueBatch(input: QueueEnqueueBatchInput): Promise<BatchEnqueueOutcome>;
enqueueMany(items: QueueEnqueueManyItem[]): Promise<BulkEnqueueOutcome>;
group(groupKey: string, profile: string | GroupProfile): GroupedQueueHandle;
}
Index
Properties
Methods
Methods
clean
- clean(
graceMs: number,
limit: number,
state: "completed" | "failed" | "cancelled",
): Promise<number>Ad-hoc retention sweep. Deletes up to
limitfinalized jobs instateolder thangraceMsmilliseconds. Useful for one-shot pruning from admin endpoints or maintenance scripts; routine retention should go through the configured cleanup tick instead.Note: this is a global sweep, not scoped to this handle's queue name — the underlying delete operates on
state + finalized_at, not on queue. Run it from one designated handle if you need a single entry point.Parameters
- graceMs: number
- limit: number
- state: "completed" | "failed" | "cancelled"
Returns Promise<number>
enqueue
Enqueue one job onto this queue.
Parameters
- kind: string
- payload: unknown
Optionaloptions: QueueEnqueueOptions
Returns Promise<EnqueueOutcome>
enqueueBatch
Fan-in batch: items + optional onComplete callback. See
Eddyq.enqueueBatch.Parameters
- input: QueueEnqueueBatchInput
Returns Promise<BatchEnqueueOutcome>
enqueueMany
Bulk-enqueue onto this queue. One Postgres round-trip for the batch.
Parameters
- items: QueueEnqueueManyItem[]
Returns Promise<BulkEnqueueOutcome>
group
Return a sub-handle pre-bound to a group key. The first call for a given (groupKey, profile) configures the group via
setGroupConcurrency/setGroupRateand memoizes the result for the life of the process.profilemay be a profile name registered on this queue (underregisterQueue({ groups })) or an inline GroupProfile.Parameters
- groupKey: string
- profile: string | GroupProfile
Returns GroupedQueueHandle
Per-queue handle returned by
@InjectQueue(name). Wraps the global Eddyq client and pre-binds the queue name + per-queue defaults so call sites don't need to repeat them.