Review funkt
This commit is contained in:
19
node_modules/bullmq/dist/esm/interfaces/advanced-options.d.ts
generated
vendored
Normal file
19
node_modules/bullmq/dist/esm/interfaces/advanced-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { BackoffStrategy } from '../types/backoff-strategy';
|
||||
import { RepeatStrategy } from '../types/repeat-strategy';
|
||||
export interface AdvancedRepeatOptions {
|
||||
/**
|
||||
* A custom cron strategy.
|
||||
*/
|
||||
repeatStrategy?: RepeatStrategy;
|
||||
/**
|
||||
* A hash algorithm to be used when trying to create the job redis key.
|
||||
* Default - md5
|
||||
*/
|
||||
repeatKeyHashAlgorithm?: string;
|
||||
}
|
||||
export interface AdvancedOptions extends AdvancedRepeatOptions {
|
||||
/**
|
||||
* A custom backoff strategy.
|
||||
*/
|
||||
backoffStrategy?: BackoffStrategy;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/advanced-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/advanced-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
20
node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts
generated
vendored
Normal file
20
node_modules/bullmq/dist/esm/interfaces/backoff-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Settings for backing off failed jobs.
|
||||
*
|
||||
* @see {@link https://docs.bullmq.io/guide/retrying-failing-jobs}
|
||||
*/
|
||||
export interface BackoffOptions {
|
||||
/**
|
||||
* Name of the backoff strategy.
|
||||
*/
|
||||
type: 'fixed' | 'exponential' | (string & {});
|
||||
/**
|
||||
* Delay in milliseconds.
|
||||
*/
|
||||
delay?: number;
|
||||
/**
|
||||
* Percentage of jitter usage.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
jitter?: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/backoff-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/backoff-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
101
node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts
generated
vendored
Normal file
101
node_modules/bullmq/dist/esm/interfaces/base-job-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
import { BackoffOptions } from './backoff-options';
|
||||
import { KeepJobs } from '../types/keep-jobs';
|
||||
import { ParentOptions } from './parent-options';
|
||||
export interface DefaultJobOptions {
|
||||
/**
|
||||
* Timestamp when the job was created.
|
||||
* @defaultValue Date.now()
|
||||
*/
|
||||
timestamp?: number;
|
||||
/**
|
||||
* Ranges from 0 to 2 097 151. `0` means no explicit priority, and jobs with
|
||||
* no explicit priority are processed before prioritized jobs. For prioritized
|
||||
* jobs, lower numbers are processed before higher numbers. Note that using
|
||||
* priorities has a slight impact on performance, so do not use it if not
|
||||
* required.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
priority?: number;
|
||||
/**
|
||||
* An amount of milliseconds to wait until this job can be processed.
|
||||
* Note that for accurate delays, worker and producers
|
||||
* should have their clocks synchronized.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
delay?: number;
|
||||
/**
|
||||
* The total number of attempts to try the job until it completes.
|
||||
* @defaultValue 1
|
||||
*/
|
||||
attempts?: number;
|
||||
/**
|
||||
* Backoff setting for automatic retries if the job fails
|
||||
*/
|
||||
backoff?: number | BackoffOptions;
|
||||
/**
|
||||
* If true, adds the job to the right of the queue instead of the left (default false)
|
||||
*
|
||||
* @see {@link https://docs.bullmq.io/guide/jobs/lifo}
|
||||
*/
|
||||
lifo?: boolean;
|
||||
/**
|
||||
* If true, removes the job when it successfully completes
|
||||
* When given a number, it specifies the maximum amount of
|
||||
* jobs to keep, or you can provide an object specifying max
|
||||
* age and/or count to keep. It overrides whatever setting is used in the worker.
|
||||
* Default behavior is to keep the job in the completed set.
|
||||
*
|
||||
* When using `age` or `count`, the eviction is evaluated on a
|
||||
* best-effort basis every time a job finishes; BullMQ does not run a
|
||||
* background timer, so aged jobs are only removed once another job
|
||||
* completes after their expiration.
|
||||
*/
|
||||
removeOnComplete?: boolean | number | KeepJobs;
|
||||
/**
|
||||
* If true, removes the job when it fails after all attempts.
|
||||
* When given a number, it specifies the maximum amount of
|
||||
* jobs to keep, or you can provide an object specifying max
|
||||
* age and/or count to keep. It overrides whatever setting is used in the worker.
|
||||
* Default behavior is to keep the job in the failed set.
|
||||
*
|
||||
* When using `age` or `count`, the eviction is evaluated on a
|
||||
* best-effort basis every time a job fails; BullMQ does not run a
|
||||
* background timer, so aged jobs are only removed once another job
|
||||
* fails after their expiration.
|
||||
*/
|
||||
removeOnFail?: boolean | number | KeepJobs;
|
||||
/**
|
||||
* Maximum amount of log entries that will be preserved
|
||||
*/
|
||||
keepLogs?: number;
|
||||
/**
|
||||
* Limits the amount of stack trace lines that will be recorded in the stacktrace.
|
||||
*/
|
||||
stackTraceLimit?: number;
|
||||
/**
|
||||
* Limits the size in bytes of the job's data payload (as a JSON serialized string).
|
||||
*/
|
||||
sizeLimit?: number;
|
||||
}
|
||||
export interface BaseJobOptions extends DefaultJobOptions {
|
||||
/**
|
||||
* Internal property used by repeatable jobs to save base repeat job key.
|
||||
*/
|
||||
repeatJobKey?: string;
|
||||
/**
|
||||
* Override the job ID - by default, the job ID is a unique
|
||||
* integer, but you can use this setting to override it.
|
||||
* If you use this option, it is up to you to ensure the
|
||||
* jobId is unique. If you attempt to add a job with an id that
|
||||
* already exists, it will not be added.
|
||||
*/
|
||||
jobId?: string;
|
||||
/**
|
||||
* Parent options
|
||||
*/
|
||||
parent?: ParentOptions;
|
||||
/**
|
||||
* Internal property used by repeatable jobs.
|
||||
*/
|
||||
prevMillis?: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/base-job-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/base-job-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
7
node_modules/bullmq/dist/esm/interfaces/child-message.d.ts
generated
vendored
Normal file
7
node_modules/bullmq/dist/esm/interfaces/child-message.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ParentCommand } from '../enums/parent-command';
|
||||
export interface ChildMessage {
|
||||
cmd: ParentCommand;
|
||||
requestId?: string;
|
||||
value?: any;
|
||||
err?: Record<string, any>;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/child-message.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/child-message.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
7
node_modules/bullmq/dist/esm/interfaces/connection.d.ts
generated
vendored
Normal file
7
node_modules/bullmq/dist/esm/interfaces/connection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import { IRedisClient } from './redis-client';
|
||||
export type RedisClient = IRedisClient;
|
||||
export interface IConnection extends EventEmitter {
|
||||
waitUntilReady(): Promise<boolean>;
|
||||
client: Promise<RedisClient>;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/connection.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/connection.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
35
node_modules/bullmq/dist/esm/interfaces/flow-job.d.ts
generated
vendored
Normal file
35
node_modules/bullmq/dist/esm/interfaces/flow-job.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { DeduplicationOptions, JobsOptions } from '../types';
|
||||
import { QueueOptions } from './queue-options';
|
||||
type FlowDeduplicationOptions = Omit<DeduplicationOptions, 'replace'>;
|
||||
type FlowJobOpts = Omit<JobsOptions, 'deduplication'> & {
|
||||
deduplication?: FlowDeduplicationOptions;
|
||||
};
|
||||
type FlowParentJobOpts = Omit<FlowJobOpts, 'deduplication' | 'parent' | 'repeat'>;
|
||||
type FlowNestedLeafJobOpts = Omit<FlowJobOpts, 'parent' | 'repeat'>;
|
||||
type FlowRootLeafJobOpts = Omit<FlowJobOpts, 'repeat'>;
|
||||
export interface FlowJobBase<T> {
|
||||
name: string;
|
||||
queueName: string;
|
||||
data?: any;
|
||||
prefix?: string;
|
||||
opts?: T;
|
||||
}
|
||||
export type FlowNestedLeafJob = FlowJobBase<FlowNestedLeafJobOpts> & {
|
||||
children?: never;
|
||||
};
|
||||
export type FlowParentJob = FlowJobBase<FlowParentJobOpts> & {
|
||||
children: FlowJobNode[];
|
||||
};
|
||||
export type FlowJobNode = FlowParentJob | FlowNestedLeafJob;
|
||||
export type FlowRootLeafJob = FlowJobBase<FlowRootLeafJobOpts> & {
|
||||
children?: never;
|
||||
};
|
||||
export type FlowJob = FlowRootLeafJob | FlowJobNode;
|
||||
export type FlowQueuesOpts = Record<string, Omit<QueueOptions, 'connection' | 'prefix'>>;
|
||||
export interface FlowOpts {
|
||||
/**
|
||||
* Map of options for Queue classes.
|
||||
*/
|
||||
queuesOptions: FlowQueuesOpts;
|
||||
}
|
||||
export {};
|
||||
1
node_modules/bullmq/dist/esm/interfaces/flow-job.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/flow-job.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
34
node_modules/bullmq/dist/esm/interfaces/index.d.ts
generated
vendored
Normal file
34
node_modules/bullmq/dist/esm/interfaces/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
export * from './advanced-options';
|
||||
export * from './backoff-options';
|
||||
export * from './base-job-options';
|
||||
export * from './child-message';
|
||||
export * from './connection';
|
||||
export * from './flow-job';
|
||||
export * from './ioredis-events';
|
||||
export * from './job-json';
|
||||
export * from './job-scheduler-json';
|
||||
export * from './lock-manager-worker-context';
|
||||
export * from './metrics-options';
|
||||
export * from './metrics';
|
||||
export * from './minimal-job';
|
||||
export * from './minimal-queue';
|
||||
export * from './parent-message';
|
||||
export * from './parent';
|
||||
export * from './parent-options';
|
||||
export * from './queue-backend';
|
||||
export * from './queue-meta';
|
||||
export * from './queue-options';
|
||||
export * from './rate-limiter-options';
|
||||
export * from './redis-client';
|
||||
export * from './redis-options';
|
||||
export * from './redis-streams';
|
||||
export * from './repeatable-options';
|
||||
export * from './repeat-options';
|
||||
export * from './retry-options';
|
||||
export * from './script-queue-context';
|
||||
export * from './sandboxed-job-processor';
|
||||
export * from './sandboxed-job';
|
||||
export * from './sandboxed-options';
|
||||
export * from './worker-options';
|
||||
export * from './telemetry';
|
||||
export * from './receiver';
|
||||
34
node_modules/bullmq/dist/esm/interfaces/index.js
generated
vendored
Normal file
34
node_modules/bullmq/dist/esm/interfaces/index.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
export * from './advanced-options';
|
||||
export * from './backoff-options';
|
||||
export * from './base-job-options';
|
||||
export * from './child-message';
|
||||
export * from './connection';
|
||||
export * from './flow-job';
|
||||
export * from './ioredis-events';
|
||||
export * from './job-json';
|
||||
export * from './job-scheduler-json';
|
||||
export * from './lock-manager-worker-context';
|
||||
export * from './metrics-options';
|
||||
export * from './metrics';
|
||||
export * from './minimal-job';
|
||||
export * from './minimal-queue';
|
||||
export * from './parent-message';
|
||||
export * from './parent';
|
||||
export * from './parent-options';
|
||||
export * from './queue-backend';
|
||||
export * from './queue-meta';
|
||||
export * from './queue-options';
|
||||
export * from './rate-limiter-options';
|
||||
export * from './redis-client';
|
||||
export * from './redis-options';
|
||||
export * from './redis-streams';
|
||||
export * from './repeatable-options';
|
||||
export * from './repeat-options';
|
||||
export * from './retry-options';
|
||||
export * from './script-queue-context';
|
||||
export * from './sandboxed-job-processor';
|
||||
export * from './sandboxed-job';
|
||||
export * from './sandboxed-options';
|
||||
export * from './worker-options';
|
||||
export * from './telemetry';
|
||||
export * from './receiver';
|
||||
8
node_modules/bullmq/dist/esm/interfaces/ioredis-events.d.ts
generated
vendored
Normal file
8
node_modules/bullmq/dist/esm/interfaces/ioredis-events.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export interface IoredisListener {
|
||||
/**
|
||||
* Listen to 'ioredis:close' event.
|
||||
*
|
||||
* This event is triggered when ioredis is closed.
|
||||
*/
|
||||
'ioredis:close': () => void;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/ioredis-events.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/ioredis-events.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
28
node_modules/bullmq/dist/esm/interfaces/job-json.d.ts
generated
vendored
Normal file
28
node_modules/bullmq/dist/esm/interfaces/job-json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { JobProgress } from '../types/job-progress';
|
||||
import { JobsOptions } from '../types/job-options';
|
||||
import { ParentKeys } from './parent';
|
||||
export interface JobJson {
|
||||
id: string;
|
||||
name: string;
|
||||
data: string;
|
||||
opts: JobsOptions;
|
||||
progress: JobProgress;
|
||||
attemptsMade: number;
|
||||
attemptsStarted: number;
|
||||
finishedOn?: number;
|
||||
processedOn?: number;
|
||||
timestamp: number;
|
||||
delay?: number;
|
||||
priority?: number;
|
||||
failedReason: string;
|
||||
stacktrace?: string;
|
||||
returnvalue: string;
|
||||
parent?: ParentKeys;
|
||||
parentKey?: string;
|
||||
repeatJobKey?: string;
|
||||
debounceId?: string;
|
||||
deduplicationId?: string;
|
||||
deferredFailure?: string;
|
||||
processedBy?: string;
|
||||
stalledCounter: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/job-json.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/job-json.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
20
node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts
generated
vendored
Normal file
20
node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { JobSchedulerTemplateOptions } from '../types';
|
||||
export interface JobSchedulerTemplateJson<D = any> {
|
||||
data?: D;
|
||||
opts?: JobSchedulerTemplateOptions;
|
||||
}
|
||||
export interface JobSchedulerJson<D = any> {
|
||||
key: string;
|
||||
name: string;
|
||||
id?: string | null;
|
||||
iterationCount?: number;
|
||||
limit?: number;
|
||||
startDate?: number;
|
||||
endDate?: number;
|
||||
tz?: string;
|
||||
pattern?: string;
|
||||
every?: number;
|
||||
next?: number;
|
||||
offset?: number;
|
||||
template?: JobSchedulerTemplateJson<D>;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/job-scheduler-json.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
24
node_modules/bullmq/dist/esm/interfaces/lock-manager-worker-context.d.ts
generated
vendored
Normal file
24
node_modules/bullmq/dist/esm/interfaces/lock-manager-worker-context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { SpanKind } from '../enums';
|
||||
import { Span } from './telemetry';
|
||||
/**
|
||||
* Minimal interface that LockManager needs from Worker.
|
||||
* This allows LockManager to access worker methods without inheriting from QueueBase.
|
||||
*/
|
||||
export interface LockManagerWorkerContext {
|
||||
/**
|
||||
* Extends locks for multiple jobs.
|
||||
*/
|
||||
extendJobLocks(jobIds: string[], tokens: string[], duration: number): Promise<string[]>;
|
||||
/**
|
||||
* Emits events to worker listeners.
|
||||
*/
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
/**
|
||||
* Wraps code with telemetry tracing.
|
||||
*/
|
||||
trace<T>(spanKind: SpanKind, operation: string, destination: string, callback: (span?: Span) => Promise<T> | T): Promise<T> | T;
|
||||
/**
|
||||
* Queue name for telemetry.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/lock-manager-worker-context.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/lock-manager-worker-context.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
13
node_modules/bullmq/dist/esm/interfaces/metrics-options.d.ts
generated
vendored
Normal file
13
node_modules/bullmq/dist/esm/interfaces/metrics-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Options for configuring metrics collection on a queue.
|
||||
*
|
||||
* @see {@link https://docs.bullmq.io/guide/metrics}
|
||||
*/
|
||||
export interface MetricsOptions {
|
||||
/**
|
||||
* Maximum number of data points to keep for the metrics.
|
||||
* Each data point represents the number of finished jobs (completed or failed)
|
||||
* collected over a one-minute granularity window.
|
||||
*/
|
||||
maxDataPoints?: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/metrics-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/metrics-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
9
node_modules/bullmq/dist/esm/interfaces/metrics.d.ts
generated
vendored
Normal file
9
node_modules/bullmq/dist/esm/interfaces/metrics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface Metrics {
|
||||
meta: {
|
||||
count: number;
|
||||
prevTS: number;
|
||||
prevCount: number;
|
||||
};
|
||||
data: number[];
|
||||
count: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/metrics.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/metrics.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
155
node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts
generated
vendored
Normal file
155
node_modules/bullmq/dist/esm/interfaces/minimal-job.d.ts
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
import { JobsOptions } from '../types/job-options';
|
||||
import { JobProgress } from '../types/job-progress';
|
||||
import { JobJsonSandbox } from '../types/job-json-sandbox';
|
||||
import { JobJson } from './job-json';
|
||||
import { ParentKeys } from './parent';
|
||||
import { ParentOptions } from './parent-options';
|
||||
export type BulkJobOptions = JobsOptions;
|
||||
export interface MoveToDelayedOpts {
|
||||
skipAttempt?: boolean;
|
||||
fieldsToUpdate?: Record<string, any>;
|
||||
fetchNext?: boolean;
|
||||
}
|
||||
export interface RetryJobOpts {
|
||||
fieldsToUpdate?: Record<string, any>;
|
||||
}
|
||||
export interface MoveToWaitingChildrenOpts {
|
||||
child?: ParentOptions;
|
||||
}
|
||||
export interface DependencyOpts {
|
||||
/**
|
||||
* Cursor value to be passed for pagination
|
||||
*/
|
||||
cursor?: number;
|
||||
/**
|
||||
* Max quantity of jobs to be retrieved
|
||||
*/
|
||||
count?: number;
|
||||
}
|
||||
export interface DependenciesOpts {
|
||||
/**
|
||||
* Options for failed child pagination
|
||||
*/
|
||||
failed?: DependencyOpts;
|
||||
/**
|
||||
* Options for ignored child pagination
|
||||
*/
|
||||
ignored?: DependencyOpts;
|
||||
/**
|
||||
* Options for processed child pagination
|
||||
*/
|
||||
processed?: DependencyOpts;
|
||||
/**
|
||||
* Options for unprocessed child pagination
|
||||
*/
|
||||
unprocessed?: DependencyOpts;
|
||||
}
|
||||
/**
|
||||
* MinimalJob
|
||||
*/
|
||||
export interface MinimalJob<DataType = any, ReturnType = any, NameType extends string = string> {
|
||||
/**
|
||||
* The name of the Job
|
||||
*/
|
||||
name: NameType;
|
||||
/**
|
||||
* The payload for this job.
|
||||
*/
|
||||
data: DataType;
|
||||
/**
|
||||
* The options object for this job.
|
||||
*/
|
||||
opts: JobsOptions;
|
||||
id?: string;
|
||||
/**
|
||||
* The progress a job has performed so far.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
progress: JobProgress;
|
||||
/**
|
||||
* The value returned by the processor when processing this job.
|
||||
* @defaultValue null
|
||||
*/
|
||||
returnvalue: ReturnType;
|
||||
/**
|
||||
* Stacktrace for the error (for failed jobs).
|
||||
* @defaultValue null
|
||||
*/
|
||||
stacktrace: string[] | null;
|
||||
/**
|
||||
* An amount of milliseconds to wait until this job can be processed.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
delay: number;
|
||||
/**
|
||||
* Timestamp when the job was created (unless overridden with job options).
|
||||
*/
|
||||
timestamp: number;
|
||||
/**
|
||||
* Number of attempts after the job has failed.
|
||||
* @defaultValue 0
|
||||
*/
|
||||
attemptsMade: number;
|
||||
/**
|
||||
* Reason for failing.
|
||||
*/
|
||||
failedReason: string;
|
||||
/**
|
||||
* Timestamp for when the job finished (completed or failed).
|
||||
*/
|
||||
finishedOn?: number;
|
||||
/**
|
||||
* Timestamp for when the job was processed.
|
||||
*/
|
||||
processedOn?: number;
|
||||
/**
|
||||
* Fully qualified key (including the queue prefix) pointing to the parent of this job.
|
||||
*/
|
||||
parentKey?: string;
|
||||
/**
|
||||
* Object that contains parentId (id) and parent queueKey.
|
||||
*/
|
||||
parent?: ParentKeys;
|
||||
/**
|
||||
* Base repeat job key.
|
||||
*/
|
||||
repeatJobKey?: string;
|
||||
/**
|
||||
* Prepares a job to be serialized for storage in Redis.
|
||||
* @returns
|
||||
*/
|
||||
asJSON(): JobJson;
|
||||
/**
|
||||
* Prepares a job to be passed to Sandbox.
|
||||
* @returns
|
||||
*/
|
||||
asJSONSandbox(): JobJsonSandbox;
|
||||
/**
|
||||
* Updates a job's data
|
||||
*
|
||||
* @param data - the data that will replace the current jobs data.
|
||||
*/
|
||||
updateData(data: DataType): Promise<void>;
|
||||
/**
|
||||
* Updates a job's progress
|
||||
*
|
||||
* @param progress - number or object to be saved as progress.
|
||||
*/
|
||||
updateProgress(progress: JobProgress): Promise<void>;
|
||||
/**
|
||||
* Logs one row of log data.
|
||||
*
|
||||
* @param logRow - string with log data to be logged.
|
||||
*/
|
||||
log(logRow: string): Promise<number>;
|
||||
get queueName(): string;
|
||||
/**
|
||||
* @returns the prefix that is used.
|
||||
*/
|
||||
get prefix(): string;
|
||||
/**
|
||||
* @returns it includes the prefix, the namespace separator :, and queue name.
|
||||
* @see {@link https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html}
|
||||
*/
|
||||
get queueQualifiedName(): string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/minimal-job.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/minimal-job.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
44
node_modules/bullmq/dist/esm/interfaces/minimal-queue.d.ts
generated
vendored
Normal file
44
node_modules/bullmq/dist/esm/interfaces/minimal-queue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Span } from './telemetry';
|
||||
import { SpanKind } from '../enums/telemetry-attributes';
|
||||
import { KeysMap } from '../classes/queue-keys';
|
||||
import { QueueBaseOptions } from './queue-options';
|
||||
import { IQueueBackend } from './queue-backend';
|
||||
/**
|
||||
* The minimal, datastore-agnostic surface that {@link Job} and other helpers
|
||||
* need from a queue. Redis specifics (client, version, …) live behind the
|
||||
* {@link IQueueBackend} the queue owns.
|
||||
*/
|
||||
export interface MinimalQueue {
|
||||
readonly name: string;
|
||||
readonly qualifiedName: string;
|
||||
keys: KeysMap;
|
||||
toKey: (type: string) => string;
|
||||
opts: QueueBaseOptions;
|
||||
closing: Promise<void> | undefined;
|
||||
/**
|
||||
* The datastore backend the queue operates through.
|
||||
*/
|
||||
backend: IQueueBackend;
|
||||
/**
|
||||
* Emits an event. Normally used by subclasses to emit events.
|
||||
*
|
||||
* @param event - The emitted event.
|
||||
* @param args -
|
||||
* @returns
|
||||
*/
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
waitUntilReady(): Promise<void>;
|
||||
/**
|
||||
* Wraps the code with telemetry and provides a span for configuration.
|
||||
*
|
||||
* @param spanKind - kind of the span: Producer, Consumer, Internal
|
||||
* @param operation - operation name (such as add, process, etc)
|
||||
* @param destination - destination name (normally the queue name)
|
||||
* @param callback - code to wrap with telemetry
|
||||
* @param srcPropagationMetadata -
|
||||
* @returns
|
||||
*/
|
||||
trace<T>(spanKind: SpanKind, operation: string, destination: string, callback: (span?: Span, dstPropagationMetadata?: string) => Promise<T> | T, srcPropagationMetadata?: string): Promise<T | Promise<T>>;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/minimal-queue.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/minimal-queue.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
8
node_modules/bullmq/dist/esm/interfaces/parent-message.d.ts
generated
vendored
Normal file
8
node_modules/bullmq/dist/esm/interfaces/parent-message.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ChildCommand } from '../enums/child-command';
|
||||
import { JobJson } from './job-json';
|
||||
export interface ParentMessage {
|
||||
cmd: ChildCommand;
|
||||
value?: any;
|
||||
err?: Error;
|
||||
job?: JobJson;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/parent-message.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/parent-message.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
11
node_modules/bullmq/dist/esm/interfaces/parent-options.d.ts
generated
vendored
Normal file
11
node_modules/bullmq/dist/esm/interfaces/parent-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export interface ParentOptions {
|
||||
/**
|
||||
* Parent identifier.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* It includes the prefix, the namespace separator :, and queue name.
|
||||
* @see {@link https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html}
|
||||
*/
|
||||
queue: string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/parent-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/parent-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
49
node_modules/bullmq/dist/esm/interfaces/parent.d.ts
generated
vendored
Normal file
49
node_modules/bullmq/dist/esm/interfaces/parent.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { JobsOptions } from '../types/job-options';
|
||||
/**
|
||||
* Describes the parent for a Job.
|
||||
*/
|
||||
export interface Parent<T> {
|
||||
/** Parent job name. */
|
||||
name: string;
|
||||
/** Prefix for the parent queue's keys. */
|
||||
prefix?: string;
|
||||
/** Name of the parent queue. */
|
||||
queue?: string;
|
||||
/** Parent job data. */
|
||||
data?: T;
|
||||
/** Job options for the parent. */
|
||||
opts?: JobsOptions;
|
||||
}
|
||||
/**
|
||||
* Redis-stored parent reference keys used internally by BullMQ.
|
||||
*/
|
||||
export interface ParentKeys {
|
||||
/** Parent job id. */
|
||||
id?: string;
|
||||
/** Qualified parent queue key prefix/name (for example, `${prefix}:${queueName}`). */
|
||||
queueKey: string;
|
||||
/** failParentOnFailure - if true, parent fails when child fails. */
|
||||
fpof?: boolean;
|
||||
/** removeDependencyOnFailure - if true, removes the child from parent's dependencies on failure. */
|
||||
rdof?: boolean;
|
||||
/** ignoreDependencyOnFailure - if true, moves the child job key to failed dependencies on failure. */
|
||||
idof?: boolean;
|
||||
/** continueParentOnFailure - if true, parent starts processing when any child fails. */
|
||||
cpof?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options used internally for parent/child relationship management when creating jobs
|
||||
* (including associating a child with its parent, or creating a parent that starts in
|
||||
* the `waiting-children` state).
|
||||
*/
|
||||
export type ParentKeyOpts = {
|
||||
/**
|
||||
* If true, the newly-created parent job will be placed into the parent queue's
|
||||
* `waiting-children` state (waiting for children to complete) instead of `wait`.
|
||||
*/
|
||||
addToWaitingChildren?: boolean;
|
||||
/** Redis key holding the parent's dependencies set. */
|
||||
parentDependenciesKey?: string;
|
||||
/** Fully-qualified Redis key of the parent job. */
|
||||
parentKey?: string;
|
||||
};
|
||||
1
node_modules/bullmq/dist/esm/interfaces/parent.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/parent.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
538
node_modules/bullmq/dist/esm/interfaces/queue-backend.d.ts
generated
vendored
Normal file
538
node_modules/bullmq/dist/esm/interfaces/queue-backend.d.ts
generated
vendored
Normal file
@@ -0,0 +1,538 @@
|
||||
import { JobJson } from './job-json';
|
||||
import { KeysMap } from '../classes/queue-keys';
|
||||
import { DependenciesOpts, MinimalJob, MoveToDelayedOpts, MoveToWaitingChildrenOpts, RetryJobOpts } from './minimal-job';
|
||||
import { ParentKeyOpts } from './parent';
|
||||
import { QueueBaseOptions } from './queue-options';
|
||||
import { RepeatableOptions } from './repeatable-options';
|
||||
import { RetryOptions } from './retry-options';
|
||||
import { StreamReadRaw } from './redis-streams';
|
||||
import { FinishedStatus, JobProgress, JobsOptions, JobState, JobType, KeepJobs } from '../types';
|
||||
type FinishedState = FinishedStatus;
|
||||
/**
|
||||
* IQueueBackend
|
||||
*
|
||||
* Database-agnostic contract describing every *high-level* operation that the
|
||||
* {@link Queue}, {@link Worker} and {@link Job} classes need in order to
|
||||
* function. The goal of this interface is to express the queue semantics
|
||||
* ("move job to active", "extend lock", "promote job", …) **independently of
|
||||
* the underlying datastore**.
|
||||
*
|
||||
* Built-in implementations currently include the Redis adapter
|
||||
* ({@link RedisQueueBackend}) and the PostgreSQL adapter. Both fulfil the same
|
||||
* operations over different datastores without requiring any change to
|
||||
* `Queue`, `Worker` or `Job`.
|
||||
*
|
||||
* The method names and signatures intentionally mirror the existing
|
||||
* `RedisQueueBackend` class so that the Redis adapter is a near
|
||||
* drop-in implementation.
|
||||
* Operations that used to be performed via direct datastore
|
||||
* commands scattered across the three classes (queue metadata, job getters,
|
||||
* the blocking "wait for next job" primitive, …) have been promoted into
|
||||
* this interface so that the three classes never need to talk to the
|
||||
* datastore directly.
|
||||
*
|
||||
* @remarks
|
||||
* Low-level, Redis-specific helpers (Lua KEYS/ARGV builders, error-code
|
||||
* mapping, `runCommand`, …) are deliberately **not** part of this contract.
|
||||
* They remain private implementation details of the Redis adapter.
|
||||
*
|
||||
* The interface intentionally exposes **no connection or transaction type**: a
|
||||
* concrete adapter owns its connection(s). For example, the Redis adapter is
|
||||
* built from a context that provides an {@link IRedisClient} (plus a dedicated
|
||||
* blocking client for {@link IQueueBackend.waitForJob}), so callers never
|
||||
* thread a connection or transaction through an operation.
|
||||
*/
|
||||
export interface IQueueBackend {
|
||||
/**
|
||||
* Resolves once the backend's underlying connection(s) are ready to accept
|
||||
* operations.
|
||||
*/
|
||||
waitUntilReady(): Promise<void>;
|
||||
/**
|
||||
* Closes the backend and its underlying connection(s), waiting for any
|
||||
* in-flight work to settle.
|
||||
*
|
||||
* @param force - When `true`, forcibly tears down the connection(s) without
|
||||
* waiting for in-flight (e.g. blocking) commands to finish.
|
||||
*/
|
||||
close(force?: boolean): Promise<void>;
|
||||
/**
|
||||
* Truthy once {@link IQueueBackend.close} has begun (resolves when the close
|
||||
* completes). Used by the worker to decide whether it is still safe to issue
|
||||
* datastore operations (e.g. completing the current job) while the
|
||||
* higher-level instance is shutting down.
|
||||
*/
|
||||
readonly closing: Promise<void> | undefined;
|
||||
/**
|
||||
* Forcibly disconnects the backend's underlying connection(s).
|
||||
*/
|
||||
disconnect(): Promise<void>;
|
||||
/**
|
||||
* Sets a human-readable name on the underlying connection (for
|
||||
* observability). No-op for backends that have no such concept.
|
||||
*/
|
||||
setName(name: string): Promise<void>;
|
||||
/**
|
||||
* Smallest meaningful block timeout (in seconds) supported by the backend's
|
||||
* blocking primitive. Used by workers to bound `waitForJob`.
|
||||
*/
|
||||
readonly minimumBlockTimeout: number;
|
||||
/**
|
||||
* Subscribes to normalized backend lifecycle events (`'ready'`, `'error'`,
|
||||
* `'close'`), derived from the underlying connection(s).
|
||||
*/
|
||||
on(event: 'ready' | 'error' | 'close', listener: (...args: any[]) => void): this;
|
||||
once(event: 'ready' | 'error' | 'close', listener: (...args: any[]) => void): this;
|
||||
removeListener(event: string, listener: (...args: any[]) => void): this;
|
||||
/**
|
||||
* Returns a sibling backend bound to a different queue (by name) that shares
|
||||
* this backend's underlying connection(s).
|
||||
*
|
||||
* This is used by {@link FlowProducer}, which spans multiple queues over a
|
||||
* single connection: every node in a flow needs datastore operations scoped
|
||||
* to its own queue, but they must all reuse the same connection. The
|
||||
* returned backend has an independent identity (its operations target the
|
||||
* given queue) but does not own the connection, so closing it is a no-op on
|
||||
* the shared connection.
|
||||
*
|
||||
* @param queueName - The queue the sibling backend should operate on.
|
||||
* @param prefix - Optional key prefix for the target queue. Flows may span
|
||||
* queues under different prefixes, so when omitted the backend's own prefix
|
||||
* is used.
|
||||
*/
|
||||
forQueue(queueName: string, prefix?: string): IQueueBackend;
|
||||
/**
|
||||
* The queue's fully-qualified name (the cross-backend logical identifier used
|
||||
* e.g. as a flow parent reference). Redis: `"<prefix>:<queue>"`.
|
||||
*/
|
||||
readonly qualifiedName: string;
|
||||
/**
|
||||
* The map of named sub-keys/identifiers for the queue. For Redis these are
|
||||
* the concrete Redis keys; backends that don't address jobs by key may return
|
||||
* an empty map.
|
||||
*/
|
||||
readonly keys: KeysMap;
|
||||
/**
|
||||
* Builds a namespaced sub-key/identifier of the given `type` for this queue
|
||||
* (e.g. a job's `"<qualifiedName>:<id>:dependencies"` key).
|
||||
*/
|
||||
toKey(type: string): string;
|
||||
/**
|
||||
* Parses a flow child/dependency node key (`"<qualifiedName>:<id>"`) back
|
||||
* into the components needed to locate the job: its queue keyspace `prefix`
|
||||
* (empty for backends without a prefix), `queueName` and `id`. Inverse of the
|
||||
* backend's key format; used when walking a flow tree.
|
||||
*/
|
||||
parseNodeKey(key: string): {
|
||||
prefix: string;
|
||||
queueName: string;
|
||||
id: string;
|
||||
};
|
||||
/**
|
||||
* Builds the connection client name (used for `setName` and worker/queue
|
||||
* discovery). Redis: `"<prefix>:<base64(queue)><suffix>"`. Backends without a
|
||||
* client-name concept may return any stable string.
|
||||
*/
|
||||
clientName(suffix?: string): string;
|
||||
/**
|
||||
* Adds a single job to the queue, routing it to the correct initial state
|
||||
* (wait / delayed / prioritized / waiting-children) based on its options.
|
||||
*
|
||||
* The backend uses its own connection — callers never pass one in.
|
||||
*/
|
||||
addJob(job: JobJson, jobId: string, parentKeyOpts?: ParentKeyOpts): Promise<string>;
|
||||
/**
|
||||
* Adds many jobs to the queue in a single, efficient operation.
|
||||
*
|
||||
* How the insert is batched (a Redis pipeline, a single multi-row SQL
|
||||
* `INSERT`, a transaction, …) is entirely an implementation detail of the
|
||||
* backend; the contract only requires that all jobs are added and their ids
|
||||
* returned in order.
|
||||
*
|
||||
* @returns The generated ids, in the same order as `entries`.
|
||||
*/
|
||||
addJobs(entries: {
|
||||
job: JobJson;
|
||||
jobId: string;
|
||||
parentKeyOpts?: ParentKeyOpts;
|
||||
}[]): Promise<string[]>;
|
||||
/**
|
||||
* Atomically inserts a flow (tree) of jobs that may span multiple queues,
|
||||
* returning one `[error, idOrCode]` tuple per entry, in the same order they
|
||||
* were provided. Each entry is self-describing (it carries its own queue
|
||||
* `prefix`/`queueName`), so the operation is not bound to a single queue.
|
||||
*
|
||||
* For the Redis adapter this is a single `MULTI`; a SQL backend would use a
|
||||
* single transaction.
|
||||
*/
|
||||
addFlow(entries: {
|
||||
jobData: JobJson;
|
||||
jobId: string;
|
||||
parentKeyOpts: ParentKeyOpts;
|
||||
prefix: string;
|
||||
queueName: string;
|
||||
}[]): Promise<[Error | null, string | number][]>;
|
||||
/**
|
||||
* Registers a job scheduler and enqueues its next delayed iteration.
|
||||
*
|
||||
* Two job-option bags are involved, with deliberately different roles:
|
||||
* - `templateOpts` — the scheduler's *template* options, stored once and
|
||||
* reused as the basis for every future iteration produced by the scheduler.
|
||||
* - `delayedJobOpts` — the fully-resolved options for the *single* delayed
|
||||
* job created right now: the template plus this iteration's `jobId`,
|
||||
* `delay`, `repeat.offset`/`count`, etc.
|
||||
*
|
||||
* @returns A tuple of `[jobId, delay]` for the next iteration.
|
||||
*/
|
||||
addJobScheduler(jobSchedulerId: string, nextMillis: number, templateData: string, templateOpts: JobsOptions, opts: RepeatableOptions, delayedJobOpts: JobsOptions, producerId?: string): Promise<[string, number]>;
|
||||
/**
|
||||
* Atomically moves the next eligible job from wait/prioritized to active,
|
||||
* returning its data (or the delay/rate-limit signals when none is ready).
|
||||
*/
|
||||
moveToActive(token: string, name?: string): Promise<any[]>;
|
||||
/**
|
||||
* Moves an active job to the completed state and, optionally, fetches the
|
||||
* next job to process.
|
||||
* @returns The next job data tuple when `fetchNext` is set, plus the
|
||||
* `finishedOn` timestamp that was recorded.
|
||||
*/
|
||||
moveToCompleted<T = any, R = any, N extends string = string>(job: MinimalJob<T, R, N>, returnValue: R, removeOnComplete: boolean | number | KeepJobs, token: string, fetchNext: boolean): Promise<{
|
||||
result: void | any[];
|
||||
finishedOn: number;
|
||||
}>;
|
||||
/**
|
||||
* Moves an active job to the failed state and, optionally, fetches the next
|
||||
* job to process.
|
||||
* @returns The next job data tuple when `fetchNext` is set, plus the
|
||||
* `finishedOn` timestamp that was recorded.
|
||||
*/
|
||||
moveToFailed<T = any, R = any, N extends string = string>(job: MinimalJob<T, R, N>, failedReason: string, removeOnFail: boolean | number | KeepJobs, token: string, fetchNext: boolean, fieldsToUpdate?: Record<string, any>): Promise<{
|
||||
result: void | any[];
|
||||
finishedOn: number;
|
||||
}>;
|
||||
/**
|
||||
* Moves a job to the delayed state, scheduling it to run after `delay` ms.
|
||||
*/
|
||||
moveToDelayed(jobId: string, timestamp: number, delay: number, token?: string, opts?: MoveToDelayedOpts): Promise<void | any[]>;
|
||||
/**
|
||||
* Moves a parent job to the waiting-children state.
|
||||
* @returns `true` if moved, `false` if there are pending dependencies.
|
||||
*/
|
||||
moveToWaitingChildren(jobId: string, token: string, opts?: MoveToWaitingChildrenOpts): Promise<boolean>;
|
||||
/**
|
||||
* Moves a (manually rate-limited) job from active back to wait.
|
||||
*/
|
||||
moveJobFromActiveToWait(jobId: string, token?: string): Promise<number>;
|
||||
/**
|
||||
* Retries a failed/active job immediately by pushing it back to wait.
|
||||
*/
|
||||
retryJob(jobId: string, lifo: boolean, token?: string, opts?: RetryJobOpts): Promise<void>;
|
||||
/**
|
||||
* Reprocesses a finished (failed/completed) job, moving it back to wait.
|
||||
*/
|
||||
retryFinishedJob<T = any, R = any, N extends string = string>(job: MinimalJob<T, R, N>, state: 'failed' | 'completed', opts?: RetryOptions): Promise<void>;
|
||||
/**
|
||||
* Promotes a single delayed job so it can be processed as soon as possible.
|
||||
*/
|
||||
promote(jobId: string): Promise<void>;
|
||||
/**
|
||||
* Recovers stalled jobs (active jobs whose lock expired) back to wait.
|
||||
* @returns The ids of the jobs that were moved.
|
||||
*/
|
||||
moveStalledJobsToWait(): Promise<string[]>;
|
||||
/**
|
||||
* Moves up to `count` finished jobs of the given `state` back to wait.
|
||||
* @returns A cursor; `0` when there are no more jobs to move.
|
||||
*/
|
||||
retryFinishedJobs(state?: FinishedState, count?: number, timestamp?: number): Promise<number>;
|
||||
/**
|
||||
* Promotes up to `count` delayed jobs back to wait.
|
||||
* @returns A cursor; `0` when there are no more jobs to promote.
|
||||
*/
|
||||
promoteJobs(count?: number): Promise<number>;
|
||||
/**
|
||||
* Pauses or resumes the whole queue.
|
||||
*/
|
||||
pause(pause: boolean): Promise<void>;
|
||||
/**
|
||||
* Removes waiting (and optionally delayed) jobs from the queue.
|
||||
*/
|
||||
drain(delayed: boolean): Promise<void>;
|
||||
/**
|
||||
* Removes jobs in a given state that are older than `timestamp`.
|
||||
* @returns The ids of the removed jobs.
|
||||
*/
|
||||
cleanJobsByState(state: string, timestamp: number, limit?: number): Promise<string[]>;
|
||||
/**
|
||||
* Irreversibly destroys the queue and all of its contents.
|
||||
* @returns A cursor; `0` when obliteration is complete.
|
||||
*/
|
||||
obliterate(opts: {
|
||||
force: boolean;
|
||||
count: number;
|
||||
}): Promise<number>;
|
||||
/**
|
||||
* Removes orphaned job keys that exist in the datastore but are not
|
||||
* referenced by any queue state set.
|
||||
* @returns The total number of orphaned jobs removed.
|
||||
*/
|
||||
removeOrphanedJobs(count?: number, limit?: number): Promise<number>;
|
||||
/**
|
||||
* Extends the lock of a single active job.
|
||||
*/
|
||||
extendLock(jobId: string, token: string, duration: number): Promise<number>;
|
||||
/**
|
||||
* Extends the lock of several active jobs at once.
|
||||
* @returns The ids of the jobs whose lock could not be extended.
|
||||
*/
|
||||
extendLocks(jobIds: string[], tokens: string[], duration: number): Promise<string[]>;
|
||||
/**
|
||||
* Replaces a job's data payload.
|
||||
*/
|
||||
updateData<T = any, R = any, N extends string = string>(job: MinimalJob<T, R, N>, data: T): Promise<void>;
|
||||
/**
|
||||
* Updates a job's progress and emits the corresponding event.
|
||||
*/
|
||||
updateProgress(jobId: string, progress: JobProgress): Promise<void>;
|
||||
/**
|
||||
* Appends a row to a job's log, optionally trimming old entries.
|
||||
* @returns The total number of log entries.
|
||||
*/
|
||||
addLog(jobId: string, logRow: string, keepLogs?: number): Promise<number>;
|
||||
/**
|
||||
* Clears a job's logs, optionally keeping the most recent `keepLogs` rows.
|
||||
*/
|
||||
clearLogs(jobId: string, keepLogs?: number): Promise<void>;
|
||||
/**
|
||||
* Changes the delay of a delayed job.
|
||||
*/
|
||||
changeDelay(jobId: string, delay: number): Promise<void>;
|
||||
/**
|
||||
* Changes the priority (and optionally lifo) of a waiting job.
|
||||
*/
|
||||
changePriority(jobId: string, priority?: number, lifo?: boolean): Promise<void>;
|
||||
/**
|
||||
* Removes a job and (optionally) its children.
|
||||
* @returns `1` if removed, `0` if it (or a dependency) was locked.
|
||||
*/
|
||||
remove(jobId: string, removeChildren: boolean): Promise<number>;
|
||||
/**
|
||||
* Removes all unprocessed children of a job.
|
||||
*/
|
||||
removeUnprocessedChildren(jobId: string): Promise<void>;
|
||||
/**
|
||||
* Removes the child→parent dependency for a not-yet-finished child.
|
||||
* @returns `true` if the dependency existed and was removed.
|
||||
*/
|
||||
removeChildDependency(jobId: string, parentKey: string): Promise<boolean>;
|
||||
/**
|
||||
* Removes a deduplication key if it still maps to the given job.
|
||||
* @returns `1` if removed, `0` otherwise.
|
||||
*/
|
||||
removeDeduplicationKey(deduplicationId: string, jobId: string): Promise<number>;
|
||||
/**
|
||||
* Unconditionally deletes a deduplication key.
|
||||
* @returns The number of keys removed.
|
||||
*/
|
||||
deleteDeduplicationKey(deduplicationId: string): Promise<number>;
|
||||
updateJobSchedulerNextMillis(jobSchedulerId: string, nextMillis: number, templateData: string, delayedJobOpts: JobsOptions, producerId?: string): Promise<string | null>;
|
||||
removeJobScheduler(jobSchedulerId: string): Promise<number>;
|
||||
getJobScheduler(id: string): Promise<[any, string | null]>;
|
||||
/**
|
||||
* Returns whether an id corresponds to a registered job scheduler.
|
||||
*/
|
||||
isJobScheduler(id: string): Promise<boolean>;
|
||||
/**
|
||||
* Returns the raw stored metadata hash for a job scheduler.
|
||||
*/
|
||||
getJobSchedulerData(key: string): Promise<Record<string, string>>;
|
||||
/**
|
||||
* Returns a range of scheduler keys with their next-run scores, flattened as
|
||||
* `[key, score, key, score, …]`.
|
||||
*/
|
||||
getJobSchedulersRange(start: number, end: number, asc: boolean): Promise<string[]>;
|
||||
/**
|
||||
* Returns the number of registered job schedulers.
|
||||
*/
|
||||
getJobSchedulersCount(): Promise<number>;
|
||||
/**
|
||||
* Returns the current state of a job.
|
||||
*/
|
||||
getState(jobId: string): Promise<JobState | 'unknown'>;
|
||||
/**
|
||||
* Returns whether a job has finished and (optionally) its result.
|
||||
*/
|
||||
isFinished(jobId: string, returnValue?: boolean): Promise<number | [number, string]>;
|
||||
/**
|
||||
* Returns whether the queue has reached its concurrency limit.
|
||||
*/
|
||||
isMaxed(): Promise<boolean>;
|
||||
/**
|
||||
* Returns whether a job id is present in the given state.
|
||||
*/
|
||||
isJobInState(state: string, jobId: string): Promise<boolean>;
|
||||
/**
|
||||
* Returns the stored data for a job, or `undefined` if it is missing.
|
||||
*/
|
||||
getJobData(jobId: string): Promise<JobJson | undefined>;
|
||||
/**
|
||||
* Returns the job id currently holding the given deduplication key, if any.
|
||||
*/
|
||||
getDeduplicationJobId(deduplicationId: string): Promise<string | null>;
|
||||
/**
|
||||
* Returns a page of a job's logs together with the total log count.
|
||||
*/
|
||||
getJobLogs(jobId: string, start: number, end: number, asc: boolean): Promise<{
|
||||
logs: string[];
|
||||
count: number;
|
||||
}>;
|
||||
/**
|
||||
* Returns the ttl (ms) of the current rate-limit window.
|
||||
*/
|
||||
getRateLimitTtl(maxJobs?: number): Promise<number>;
|
||||
getCounts(types: JobType[]): Promise<number[]>;
|
||||
getCountsPerPriority(priorities: number[]): Promise<number[]>;
|
||||
getRanges(types: JobType[], start?: number, end?: number, asc?: boolean): Promise<[string][]>;
|
||||
getDependencyCounts(jobId: string, types: string[]): Promise<number[]>;
|
||||
/**
|
||||
* Returns a job's children dependencies (processed/unprocessed/ignored/failed).
|
||||
*/
|
||||
getDependencies(jobId: string, opts: DependenciesOpts): Promise<{
|
||||
nextFailedCursor?: number;
|
||||
failed?: string[];
|
||||
nextIgnoredCursor?: number;
|
||||
ignored?: Record<string, any>;
|
||||
nextProcessedCursor?: number;
|
||||
processed?: Record<string, any>;
|
||||
nextUnprocessedCursor?: number;
|
||||
unprocessed?: string[];
|
||||
}>;
|
||||
/**
|
||||
* Returns the raw processed-children map (child key → serialized value).
|
||||
*/
|
||||
getProcessedChildrenValues(jobId: string): Promise<Record<string, string>>;
|
||||
/**
|
||||
* Returns the raw ignored-children failures map (child key → reason).
|
||||
*/
|
||||
getIgnoredChildrenFailures(jobId: string): Promise<Record<string, string>>;
|
||||
getMetrics(type: 'completed' | 'failed', start?: number, end?: number): Promise<[string[], string[], number]>;
|
||||
/**
|
||||
* Returns the raw worker/client list(s) for the queue's datastore. For the
|
||||
* Redis adapter this is `CLIENT LIST` (one string per cluster node, or a
|
||||
* single string otherwise). Backends with no notion of connected clients
|
||||
* may return an empty array.
|
||||
*/
|
||||
getClientList(): Promise<string[]>;
|
||||
/**
|
||||
* Paginates a datastore set or hash, optionally fetching the jobs themselves.
|
||||
*/
|
||||
paginate(key: string, opts: {
|
||||
start: number;
|
||||
end: number;
|
||||
fetchJobs?: boolean;
|
||||
}): Promise<{
|
||||
cursor: string;
|
||||
items: {
|
||||
id: string;
|
||||
v?: any;
|
||||
err?: string;
|
||||
}[];
|
||||
total: number;
|
||||
jobs?: JobJson[];
|
||||
}>;
|
||||
/**
|
||||
* Sets one or more queue metadata fields.
|
||||
*/
|
||||
setQueueMeta(values: Record<string, string | number>): Promise<number>;
|
||||
/**
|
||||
* Reads a single queue metadata field.
|
||||
*/
|
||||
getQueueMetaField(field: string): Promise<string | null>;
|
||||
/**
|
||||
* Reads several queue metadata fields at once, in order.
|
||||
*/
|
||||
getQueueMetaFields(fields: string[]): Promise<(string | null)[]>;
|
||||
/**
|
||||
* Reads the entire queue metadata hash.
|
||||
*/
|
||||
getQueueMeta(): Promise<Record<string, string>>;
|
||||
/**
|
||||
* Removes one or more queue metadata fields.
|
||||
*/
|
||||
removeQueueMetaFields(fields: string[]): Promise<number>;
|
||||
/**
|
||||
* Returns whether a queue metadata field exists.
|
||||
*/
|
||||
hasQueueMetaField(field: string): Promise<boolean>;
|
||||
/**
|
||||
* Sets the global rate-limit window for the next jobs.
|
||||
*/
|
||||
setRateLimit(expireTimeMs: number): Promise<void>;
|
||||
/**
|
||||
* Removes the rate-limit key.
|
||||
* @returns The number of keys removed.
|
||||
*/
|
||||
removeRateLimitKey(): Promise<number>;
|
||||
/**
|
||||
* Removes the deprecated priority helper key.
|
||||
* @returns The number of keys removed.
|
||||
*/
|
||||
removeDeprecatedPriorityKey(): Promise<number>;
|
||||
/**
|
||||
* Trims the event stream to an approximate maximum length.
|
||||
* @returns The number of entries removed.
|
||||
*/
|
||||
trimEvents(maxLength: number): Promise<number>;
|
||||
/**
|
||||
* Publishes a custom event to the queue's event stream.
|
||||
* @returns The id of the appended event entry.
|
||||
*/
|
||||
publishEvent(fields: Record<string, string | number>, maxEvents: number): Promise<string>;
|
||||
/**
|
||||
* Blocks (up to `blockTimeout` ms) reading the queue's event stream for
|
||||
* entries newer than `id`, returning the raw stream entries (or a falsy value
|
||||
* on timeout). For the Redis adapter this is an `XREAD ... BLOCK`.
|
||||
*/
|
||||
readEvents(id: string, blockTimeout: number): Promise<StreamReadRaw>;
|
||||
/**
|
||||
* Blocks (up to `blockTimeout` seconds) until the queue signals that a new
|
||||
* job may be available, returning the next "block-until" timestamp.
|
||||
*
|
||||
* For the Redis adapter this is a `BZPOPMIN` on the marker sorted set using
|
||||
* the adapter's own dedicated blocking connection; other adapters may
|
||||
* implement it via `LISTEN`/`NOTIFY`, change-data-capture or polling.
|
||||
*
|
||||
* @returns The marker member/score on success, or `null` on timeout.
|
||||
*/
|
||||
waitForJob(blockTimeout: number): Promise<{
|
||||
member: string;
|
||||
score: number;
|
||||
} | null>;
|
||||
/**
|
||||
* Interrupts the backend's in-flight blocking wait (so a worker can stop or
|
||||
* recover). No-op for backends without a dedicated blocking connection.
|
||||
*/
|
||||
disconnectBlocking(wait?: boolean): Promise<void>;
|
||||
/**
|
||||
* Re-establishes the backend's blocking connection after an interrupt.
|
||||
*/
|
||||
reconnectBlocking(): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* Factory that builds an {@link IQueueBackend} for a given queue. Injected into
|
||||
* the queue classes so they depend only on the abstraction, never on a concrete
|
||||
* datastore/connection. The default factory is the Redis one
|
||||
* (`createRedisBackend`).
|
||||
*
|
||||
* The factory is generic over the concrete backend type `B` it produces, so a
|
||||
* caller (or class) parameterized on `B` keeps the concrete typing end-to-end
|
||||
* (e.g. `getBackend()` returning the concrete adapter instead of the bare
|
||||
* interface).
|
||||
*/
|
||||
export type BackendFactory<B extends IQueueBackend = IQueueBackend> = (name: string, opts: QueueBaseOptions, options?: {
|
||||
/** The backend's main connection is itself blocking (e.g. QueueEvents). */
|
||||
blocking?: boolean;
|
||||
/** Provision a dedicated blocking connection (workers). */
|
||||
withBlockingConnection?: boolean;
|
||||
}) => B;
|
||||
export {};
|
||||
1
node_modules/bullmq/dist/esm/interfaces/queue-backend.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/queue-backend.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
46
node_modules/bullmq/dist/esm/interfaces/queue-meta.d.ts
generated
vendored
Normal file
46
node_modules/bullmq/dist/esm/interfaces/queue-meta.d.ts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Publicly relevant metadata fields for a Queue, read from the queue's
|
||||
* Redis `meta` key.
|
||||
*
|
||||
* This interface documents the subset of meta-hash fields that BullMQ
|
||||
* exposes to consumers (e.g. via `Queue.getQueueOpts`, `Queue.getRateLimit`,
|
||||
* `Queue.isPaused`); the underlying hash also stores internal fields
|
||||
* (e.g. metrics counters) that are not part of this type.
|
||||
*/
|
||||
export interface QueueMeta {
|
||||
/**
|
||||
* Maximum number of jobs that can be processed concurrently across all
|
||||
* workers attached to this queue. Set via `Queue.setGlobalConcurrency`.
|
||||
*/
|
||||
concurrency?: number;
|
||||
/**
|
||||
* Maximum number of jobs allowed in the rate-limit window of `duration`
|
||||
* milliseconds. Set via `Queue.setGlobalRateLimit`.
|
||||
*/
|
||||
max?: number;
|
||||
/**
|
||||
* Length of the rate-limit window in milliseconds, paired with `max`.
|
||||
* Set via `Queue.setGlobalRateLimit`.
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* Maximum length of the queue's events stream. Older events are evicted
|
||||
* in FIFO order once the stream grows beyond this size.
|
||||
*
|
||||
* Note: `maxLenEvents` is not a guaranteed upper bound. BullMQ relies on
|
||||
* Redis's `XTRIM` "fast trim" (`MAXLEN ~ N`), which is a best-effort
|
||||
* cap — the stream may retain noticeably more events than this value at
|
||||
* any given moment.
|
||||
*/
|
||||
maxLenEvents?: number;
|
||||
/**
|
||||
* True when the queue has been paused. While paused, workers will not
|
||||
* pick up new jobs.
|
||||
*/
|
||||
paused?: boolean;
|
||||
/**
|
||||
* BullMQ version that produced this queue's data, used for compatibility
|
||||
* checks across upgrades.
|
||||
*/
|
||||
version?: string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/queue-meta.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/queue-meta.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
124
node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts
generated
vendored
Normal file
124
node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
import { AdvancedRepeatOptions } from './advanced-options';
|
||||
import { DefaultJobOptions } from './base-job-options';
|
||||
import { ConnectionOptions } from './redis-options';
|
||||
import { Telemetry } from './telemetry';
|
||||
export declare enum ClientType {
|
||||
blocking = "blocking",
|
||||
normal = "normal"
|
||||
}
|
||||
/**
|
||||
* Base Queue options
|
||||
*/
|
||||
export interface QueueBaseOptions {
|
||||
/**
|
||||
* Options for connecting to a Redis instance.
|
||||
*/
|
||||
connection: ConnectionOptions;
|
||||
/**
|
||||
* Denotes commands should retry indefinitely.
|
||||
* @deprecated not in use anymore.
|
||||
*/
|
||||
blockingConnection?: boolean;
|
||||
/**
|
||||
* Avoid version validation to be greater or equal than v5.0.0.
|
||||
* @defaultValue false
|
||||
*/
|
||||
skipVersionCheck?: boolean;
|
||||
/**
|
||||
* Telemetry client
|
||||
*/
|
||||
telemetry?: Telemetry;
|
||||
/**
|
||||
* Skip waiting for connection ready.
|
||||
*
|
||||
* In some instances if you want the queue to fail fast if the connection is
|
||||
* not ready you can set this to true. This could be useful for testing and when
|
||||
* adding jobs via HTTP endpoints for example.
|
||||
*
|
||||
*/
|
||||
skipWaitingForReady?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options honored only by the Redis backend. The key `prefix` namespaces all of
|
||||
* a queue's Redis keys, so BullMQ data can coexist with other keys in a shared
|
||||
* keyspace. It is intentionally NOT part of {@link QueueBaseOptions}, because it
|
||||
* is a Redis-specific concept: other backends namespace differently (e.g. the
|
||||
* PostgreSQL backend uses a schema) and ignore it.
|
||||
*/
|
||||
export interface KeyPrefixOptions {
|
||||
/**
|
||||
* Prefix for all queue keys (Redis backend only). Defaults to `bull`.
|
||||
*/
|
||||
prefix?: string;
|
||||
}
|
||||
/**
|
||||
* @deprecated Use KeyPrefixOptions instead.
|
||||
*/
|
||||
export type RedisKeyPrefixOptions = KeyPrefixOptions;
|
||||
/**
|
||||
* Options for the Queue class.
|
||||
*/
|
||||
export interface QueueOptions extends QueueBaseOptions, KeyPrefixOptions {
|
||||
defaultJobOptions?: DefaultJobOptions;
|
||||
/**
|
||||
* Options for the streams used internally in BullMQ.
|
||||
*/
|
||||
streams?: {
|
||||
/**
|
||||
* Options for the events stream.
|
||||
*/
|
||||
events: {
|
||||
/**
|
||||
* Max approximated length for streams. Default is 10 000 events.
|
||||
*/
|
||||
maxLen: number;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Skip Meta update.
|
||||
*
|
||||
* If true, the queue will not update the metadata of the queue.
|
||||
* Useful for read-only systems that do should not update the metadata.
|
||||
*
|
||||
* @defaultValue false
|
||||
*/
|
||||
skipMetasUpdate?: boolean;
|
||||
/**
|
||||
* Advanced options for the repeatable jobs.
|
||||
*/
|
||||
settings?: AdvancedRepeatOptions;
|
||||
}
|
||||
/**
|
||||
* Options for the Repeat class.
|
||||
*/
|
||||
export interface RepeatBaseOptions extends QueueBaseOptions, KeyPrefixOptions {
|
||||
settings?: AdvancedRepeatOptions;
|
||||
}
|
||||
/**
|
||||
* Options for QueueEvents
|
||||
*/
|
||||
export interface QueueEventsOptions extends Omit<QueueBaseOptions, 'telemetry'>, KeyPrefixOptions {
|
||||
/**
|
||||
* Condition to start listening to events at instance creation.
|
||||
*/
|
||||
autorun?: boolean;
|
||||
/**
|
||||
* Last event Id. If provided it is possible to continue
|
||||
* consuming events from a known Id instead of from the last
|
||||
* produced event.
|
||||
*/
|
||||
lastEventId?: string;
|
||||
/**
|
||||
* Timeout for the blocking XREAD call to the events stream.
|
||||
*/
|
||||
blockingTimeout?: number;
|
||||
}
|
||||
/**
|
||||
* Options for QueueEventsProducer
|
||||
*/
|
||||
export type QueueEventsProducerOptions = Omit<QueueBaseOptions, 'telemetry'> & KeyPrefixOptions;
|
||||
/**
|
||||
* Options for the FlowProducer class.
|
||||
*/
|
||||
export interface FlowProducerOptions extends QueueBaseOptions, KeyPrefixOptions {
|
||||
}
|
||||
5
node_modules/bullmq/dist/esm/interfaces/queue-options.js
generated
vendored
Normal file
5
node_modules/bullmq/dist/esm/interfaces/queue-options.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export var ClientType;
|
||||
(function (ClientType) {
|
||||
ClientType["blocking"] = "blocking";
|
||||
ClientType["normal"] = "normal";
|
||||
})(ClientType || (ClientType = {}));
|
||||
12
node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.d.ts
generated
vendored
Normal file
12
node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface RateLimiterOptions {
|
||||
/**
|
||||
* Max number of jobs to process in the time period
|
||||
* specified in `duration`.
|
||||
*/
|
||||
max: number;
|
||||
/**
|
||||
* Time in milliseconds. During this time, a maximum
|
||||
* of `max` jobs will be processed.
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/rate-limiter-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
node_modules/bullmq/dist/esm/interfaces/receiver.d.ts
generated
vendored
Normal file
4
node_modules/bullmq/dist/esm/interfaces/receiver.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface Receiver {
|
||||
on: (evt: 'message', cb: (msg: any) => void) => void;
|
||||
off: (evt: 'message', cb: (msg: any) => void) => void;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/receiver.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/receiver.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
181
node_modules/bullmq/dist/esm/interfaces/redis-client.d.ts
generated
vendored
Normal file
181
node_modules/bullmq/dist/esm/interfaces/redis-client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import { Readable } from 'stream';
|
||||
/**
|
||||
* Redis client interface for BullMQ.
|
||||
*
|
||||
* Abstracts the underlying Redis client library (ioredis, node-redis, Bun
|
||||
* built-in Redis, etc.) while keeping Redis semantics. Only the Redis
|
||||
* commands that BullMQ actually uses are declared here.
|
||||
*
|
||||
* Method signatures use **structured options objects** instead of ioredis-style
|
||||
* varargs so that every adapter (ioredis, node-redis, Bun, …) can map the
|
||||
* call to its native API without parsing positional string tokens.
|
||||
*
|
||||
* The reference implementation for ioredis lives in
|
||||
* `src/classes/ioredis-client.ts`.
|
||||
*/
|
||||
export interface IRedisClient {
|
||||
/**
|
||||
* Current connection status.
|
||||
* Adapters must expose at least the values `'ready'`, `'wait'`, and
|
||||
* `'end'` so that {@link RedisConnection.waitUntilReady} works correctly.
|
||||
*/
|
||||
status: string;
|
||||
/** Whether this client is connected to a Redis Cluster. */
|
||||
readonly isCluster: boolean;
|
||||
/** Client configuration options (shape is adapter-specific). */
|
||||
options: Record<string, any>;
|
||||
connect(): Promise<void>;
|
||||
disconnect(reconnect?: boolean): void;
|
||||
quit(): Promise<string>;
|
||||
/** Create a duplicate connection with optional overrides. */
|
||||
duplicate(...args: any[]): IRedisClient;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
removeListener(event: string, listener: (...args: any[]) => void): this;
|
||||
off(event: string, listener: (...args: any[]) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
setMaxListeners(n: number): this;
|
||||
getMaxListeners(): number;
|
||||
removeAllListeners(event?: string | symbol): this;
|
||||
/**
|
||||
* Register a Lua script as a named command so it can later be invoked via
|
||||
* {@link runCommand}.
|
||||
*
|
||||
* @param name - Command name that will be callable via runCommand.
|
||||
* @param definition - Script definition.
|
||||
* - `numberOfKeys` – number of KEYS[] arguments the script expects.
|
||||
* - `lua` – Lua source code.
|
||||
* - `readOnly` – (optional) hint that the script only reads data;
|
||||
* some adapters (e.g. ioredis) use this to route the
|
||||
* call to a replica in read-only mode.
|
||||
*/
|
||||
defineCommand(name: string, definition: {
|
||||
numberOfKeys: number;
|
||||
lua: string;
|
||||
readOnly?: boolean;
|
||||
}): void;
|
||||
/**
|
||||
* Execute a previously registered Lua script command by name.
|
||||
*
|
||||
* @param name - The command name passed to {@link defineCommand}.
|
||||
* @param args - Arguments forwarded to the script (KEYS first, then ARGV).
|
||||
* @returns A `Promise<any>` whose resolved value matches the return value of
|
||||
* the Lua script. BullMQ scripts return integers, strings, or arrays of
|
||||
* strings/integers. Callers in {@link Scripts.execCommand} cast the result
|
||||
* to the expected concrete type after the call.
|
||||
*/
|
||||
runCommand(name: string, args: any[]): Promise<any>;
|
||||
multi(): IRedisTransaction;
|
||||
pipeline(): IRedisTransaction;
|
||||
hgetall(key: string): Promise<Record<string, string>>;
|
||||
hget(key: string, field: string): Promise<string | null>;
|
||||
hmget(key: string, ...fields: string[]): Promise<(string | null)[]>;
|
||||
/** SET one or more hash fields from a field→value map. */
|
||||
hset(key: string, data: Record<string, string | number>): Promise<number>;
|
||||
hdel(key: string, ...fields: string[]): Promise<number>;
|
||||
hexists(key: string, field: string): Promise<number>;
|
||||
get(key: string): Promise<string | null>;
|
||||
set(key: string, value: string | number, options?: {
|
||||
PX?: number;
|
||||
EX?: number;
|
||||
}): Promise<string | null>;
|
||||
del(...keys: string[]): Promise<number>;
|
||||
zrange(key: string, start: number, end: number, options?: {
|
||||
WITHSCORES?: boolean;
|
||||
}): Promise<string[]>;
|
||||
zrevrange(key: string, start: number, end: number, options?: {
|
||||
WITHSCORES?: boolean;
|
||||
}): Promise<string[]>;
|
||||
zcard(key: string): Promise<number>;
|
||||
zscore(key: string, member: string): Promise<string | null>;
|
||||
lrange(key: string, start: number, end: number): Promise<string[]>;
|
||||
llen(key: string): Promise<number>;
|
||||
ltrim(key: string, start: number, end: number): Promise<string>;
|
||||
lpos(key: string, value: string): Promise<number | null>;
|
||||
smembers(key: string): Promise<string[]>;
|
||||
/**
|
||||
* Append an entry to a stream.
|
||||
*
|
||||
* @param key - Stream key
|
||||
* @param id - Entry ID (typically `'*'` for auto-generated)
|
||||
* @param fields - Field-value pairs for the stream entry
|
||||
* @param options - Optional MAXLEN trimming parameters
|
||||
*/
|
||||
xadd(key: string, id: string, fields: Record<string, string | number>, options?: {
|
||||
MAXLEN?: number;
|
||||
approximate?: boolean;
|
||||
}): Promise<string>;
|
||||
/**
|
||||
* Read from one or more streams.
|
||||
*
|
||||
* @param streams - Array of stream/id pairs to read from
|
||||
* @param options - Optional BLOCK timeout and COUNT
|
||||
*/
|
||||
xread(streams: {
|
||||
key: string;
|
||||
id: string;
|
||||
}[], options?: {
|
||||
BLOCK?: number;
|
||||
COUNT?: number;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* Trim a stream.
|
||||
*
|
||||
* @param key - Stream key
|
||||
* @param strategy - Trim strategy (e.g. `'MAXLEN'`)
|
||||
* @param threshold - Maximum stream length
|
||||
* @param options - Optional approximate trimming
|
||||
*/
|
||||
xtrim(key: string, strategy: 'MAXLEN', threshold: number, options?: {
|
||||
approximate?: boolean;
|
||||
}): Promise<number>;
|
||||
/**
|
||||
* Block until an element is available in the given sorted set, or the
|
||||
* timeout expires.
|
||||
*
|
||||
* The return shape mirrors ioredis' native `bzpopmin`:
|
||||
* `[key, member, score]` on success, or `null` on timeout. Adapters for
|
||||
* other clients (node-redis, bun) MUST convert their native return value
|
||||
* to this tuple form. This avoids mutating the shape of `bzpopmin` on
|
||||
* shared ioredis instances, which would be a breaking change for code
|
||||
* that uses the same client outside of BullMQ.
|
||||
*/
|
||||
bzpopmin(key: string, timeout: number): Promise<[key: string, member: string, score: string] | null>;
|
||||
info(): Promise<string>;
|
||||
clientSetName(name: string): Promise<any>;
|
||||
clientList(): Promise<string>;
|
||||
scan(cursor: string | number, options: {
|
||||
MATCH?: string;
|
||||
COUNT?: number;
|
||||
}): Promise<[string, string[]]>;
|
||||
scanStream(options: {
|
||||
match: string;
|
||||
count?: number;
|
||||
}): Readable;
|
||||
/** Return connections for each cluster node (only when isCluster). */
|
||||
nodes?(): IRedisClient[];
|
||||
}
|
||||
/**
|
||||
* Redis pipeline or transaction (MULTI).
|
||||
*
|
||||
* Commands are queued and executed together via {@link exec}.
|
||||
* Only the subset of commands BullMQ uses inside pipelines is declared.
|
||||
*/
|
||||
export interface IRedisTransaction {
|
||||
hgetall(key: string): this;
|
||||
hset(key: string, data: Record<string, string | number>): this;
|
||||
hscan(key: string, cursor: string | number, options?: {
|
||||
COUNT?: number;
|
||||
}): this;
|
||||
smembers(key: string): this;
|
||||
sscan(key: string, cursor: string | number, options?: {
|
||||
COUNT?: number;
|
||||
}): this;
|
||||
zrange(key: string, start: number, end: number): this;
|
||||
lrange(key: string, start: number, end: number): this;
|
||||
llen(key: string): this;
|
||||
del(...keys: string[]): this;
|
||||
runCommand(name: string, args: any[]): this;
|
||||
/** Execute all queued commands. */
|
||||
exec(): Promise<[Error | null, any][] | null>;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/redis-client.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/redis-client.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
9
node_modules/bullmq/dist/esm/interfaces/redis-options.d.ts
generated
vendored
Normal file
9
node_modules/bullmq/dist/esm/interfaces/redis-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type * as IORedis from 'ioredis';
|
||||
import { IRedisClient } from './redis-client';
|
||||
export interface BaseOptions {
|
||||
skipVersionCheck?: boolean;
|
||||
url?: string;
|
||||
}
|
||||
export type RedisOptions = IORedis.RedisOptions & BaseOptions;
|
||||
export type ClusterOptions = IORedis.ClusterOptions & BaseOptions;
|
||||
export type ConnectionOptions = RedisOptions | ClusterOptions | IORedis.Redis | IRedisClient | IORedis.Cluster;
|
||||
1
node_modules/bullmq/dist/esm/interfaces/redis-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/redis-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
node_modules/bullmq/dist/esm/interfaces/redis-streams.d.ts
generated
vendored
Normal file
4
node_modules/bullmq/dist/esm/interfaces/redis-streams.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export type StreamName = string;
|
||||
export type EntryId = string;
|
||||
export type EntryRaw = [EntryId, string[]];
|
||||
export type StreamReadRaw = [StreamName, EntryRaw[]][] | null | undefined;
|
||||
1
node_modules/bullmq/dist/esm/interfaces/redis-streams.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/redis-streams.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
62
node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts
generated
vendored
Normal file
62
node_modules/bullmq/dist/esm/interfaces/repeat-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Settings for repeatable jobs
|
||||
*
|
||||
* @see {@link https://docs.bullmq.io/guide/jobs/repeatable}
|
||||
*/
|
||||
export interface RepeatOptions {
|
||||
/**
|
||||
* End date when job should stop
|
||||
*/
|
||||
endDate?: Date | string | number;
|
||||
/**
|
||||
* Start date when job should start
|
||||
*/
|
||||
startDate?: Date | string | number;
|
||||
/**
|
||||
* A repeat pattern
|
||||
*/
|
||||
pattern?: string;
|
||||
/**
|
||||
* Custom repeatable key. This is the key that holds the "metadata"
|
||||
* of a given repeatable job. This key is normally auto-generated but
|
||||
* it is sometimes useful to specify a custom key for easier retrieval
|
||||
* of repeatable jobs.
|
||||
*/
|
||||
key?: string;
|
||||
/**
|
||||
* Number of times the job should repeat at max.
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Repeat after this amount of milliseconds
|
||||
* (`pattern` setting cannot be used together with this setting.)
|
||||
*/
|
||||
every?: number;
|
||||
/**
|
||||
* Repeated job should start right now
|
||||
* ( work only with cron settings)
|
||||
*/
|
||||
immediately?: boolean;
|
||||
/**
|
||||
* The start value for the repeat iteration count.
|
||||
*/
|
||||
count?: number;
|
||||
/**
|
||||
* Offset in milliseconds to affect the next iteration time
|
||||
* */
|
||||
offset?: number;
|
||||
/**
|
||||
* Internal property to store the previous time the job was executed.
|
||||
*/
|
||||
prevMillis?: number;
|
||||
/**
|
||||
* Internal property to store the job id
|
||||
* @deprecated not in use anymore
|
||||
*/
|
||||
jobId?: string;
|
||||
/**
|
||||
* Timezone
|
||||
* @see {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones}
|
||||
*/
|
||||
tz?: string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/repeat-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/repeat-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
10
node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts
generated
vendored
Normal file
10
node_modules/bullmq/dist/esm/interfaces/repeatable-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export type RepeatableOptions = {
|
||||
name: string;
|
||||
startDate?: number;
|
||||
endDate?: number;
|
||||
tz?: string;
|
||||
limit?: number;
|
||||
pattern?: string;
|
||||
every?: number;
|
||||
offset?: number;
|
||||
};
|
||||
1
node_modules/bullmq/dist/esm/interfaces/repeatable-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/repeatable-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
13
node_modules/bullmq/dist/esm/interfaces/retry-options.d.ts
generated
vendored
Normal file
13
node_modules/bullmq/dist/esm/interfaces/retry-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Retry method options
|
||||
*/
|
||||
export interface RetryOptions {
|
||||
/**
|
||||
* Attempts made counter is reset to zero when retrying the job.
|
||||
*/
|
||||
resetAttemptsMade?: boolean;
|
||||
/**
|
||||
* Attempts started counter is reset to zero when retrying the job.
|
||||
*/
|
||||
resetAttemptsStarted?: boolean;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/retry-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/retry-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
5
node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.d.ts
generated
vendored
Normal file
5
node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { SandboxedJob } from './sandboxed-job';
|
||||
/**
|
||||
* @see {@link https://docs.bullmq.io/guide/workers/sandboxed-processors}
|
||||
*/
|
||||
export type SandboxedJobProcessor<T = any, R = any> = ((job: SandboxedJob<T, R>) => R | PromiseLike<R>) | ((job: SandboxedJob<T, R>, callback: (error: unknown, result: R) => void) => void);
|
||||
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-job-processor.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
34
node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts
generated
vendored
Normal file
34
node_modules/bullmq/dist/esm/interfaces/sandboxed-job.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { JobJsonSandbox, JobProgress, JobsOptions } from '../types';
|
||||
import { MoveToWaitingChildrenOpts } from './minimal-job';
|
||||
/**
|
||||
* @see {@link https://docs.bullmq.io/guide/workers/sandboxed-processors}
|
||||
*/
|
||||
export interface SandboxedJob<T = any, R = any> extends Omit<JobJsonSandbox, 'data' | 'opts' | 'returnvalue'> {
|
||||
data: T;
|
||||
opts: JobsOptions;
|
||||
queueQualifiedName: string;
|
||||
moveToDelayed: (timestamp: number, token?: string) => Promise<void>;
|
||||
moveToWait: (token?: string) => Promise<void>;
|
||||
moveToWaitingChildren: (token?: string, opts?: MoveToWaitingChildrenOpts) => Promise<boolean>;
|
||||
log: (row: string) => void;
|
||||
updateData: (data: T) => Promise<void>;
|
||||
updateProgress: (value: JobProgress) => Promise<void>;
|
||||
getChildrenValues: <CT = any>() => Promise<{
|
||||
[jobKey: string]: CT;
|
||||
}>;
|
||||
getIgnoredChildrenFailures: () => Promise<{
|
||||
[jobKey: string]: string;
|
||||
}>;
|
||||
getDependenciesCount: (opts?: {
|
||||
failed?: boolean;
|
||||
ignored?: boolean;
|
||||
processed?: boolean;
|
||||
unprocessed?: boolean;
|
||||
}) => Promise<{
|
||||
failed?: number;
|
||||
ignored?: number;
|
||||
processed?: number;
|
||||
unprocessed?: number;
|
||||
}>;
|
||||
returnValue: R;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-job.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-job.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
26
node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts
generated
vendored
Normal file
26
node_modules/bullmq/dist/esm/interfaces/sandboxed-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { ForkOptions } from 'child_process';
|
||||
import { WorkerOptions as WorkerThreadsOptions } from 'worker_threads';
|
||||
export interface SandboxedOptions {
|
||||
/**
|
||||
* Use Worker Threads instead of Child Processes.
|
||||
* Note: This option can only be used when specifying
|
||||
* a file for the processor argument.
|
||||
*
|
||||
* @defaultValue false
|
||||
*/
|
||||
useWorkerThreads?: boolean;
|
||||
/**
|
||||
* Support passing Worker Fork Options.
|
||||
* Note: This option can only be used when specifying
|
||||
* a file for the processor argument and useWorkerThreads is passed as false (default value).
|
||||
* @see {@link https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options}
|
||||
*/
|
||||
workerForkOptions?: ForkOptions;
|
||||
/**
|
||||
* Support passing Worker Threads Options.
|
||||
* Note: This option can only be used when specifying
|
||||
* a file for the processor argument and useWorkerThreads is passed as true.
|
||||
* @see {@link https://nodejs.org/api/worker_threads.html#new-workerfilename-options}
|
||||
*/
|
||||
workerThreadsOptions?: WorkerThreadsOptions;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/sandboxed-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
28
node_modules/bullmq/dist/esm/interfaces/script-queue-context.d.ts
generated
vendored
Normal file
28
node_modules/bullmq/dist/esm/interfaces/script-queue-context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { RedisClient } from './connection';
|
||||
import { QueueBaseOptions } from './queue-options';
|
||||
import { KeysMap } from '../classes/queue-keys';
|
||||
import { DatabaseType } from '../types/database-type';
|
||||
export interface ScriptQueueContext {
|
||||
opts: QueueBaseOptions;
|
||||
toKey: (type: string) => string;
|
||||
keys: KeysMap;
|
||||
closing: Promise<void> | undefined;
|
||||
/**
|
||||
* Returns a promise that resolves to a redis client. Normally used only by subclasses.
|
||||
*/
|
||||
get client(): Promise<RedisClient>;
|
||||
/**
|
||||
* Optional dedicated blocking connection used by the backend's
|
||||
* `waitForJob` primitive. Only workers provide it; other contexts (e.g. a
|
||||
* plain Queue) leave it undefined since they never block waiting for jobs.
|
||||
*/
|
||||
blockingClient?: Promise<RedisClient>;
|
||||
/**
|
||||
* Returns the database type of the Redis instance the client is connected to,
|
||||
*/
|
||||
get databaseType(): DatabaseType;
|
||||
/**
|
||||
* Returns the version of the Redis instance the client is connected to,
|
||||
*/
|
||||
get redisVersion(): string;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/script-queue-context.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/script-queue-context.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
254
node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts
generated
vendored
Normal file
254
node_modules/bullmq/dist/esm/interfaces/telemetry.d.ts
generated
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
import { SpanKind } from '../enums';
|
||||
/**
|
||||
* Telemetry interface
|
||||
*
|
||||
* This interface allows third-party libraries to integrate their own telemetry
|
||||
* system. The interface is heavily inspired by OpenTelemetry but it's not
|
||||
* limited to it.
|
||||
*
|
||||
*/
|
||||
export interface Telemetry<Context = any> {
|
||||
/**
|
||||
* Tracer instance
|
||||
*
|
||||
* The tracer is responsible for creating spans and propagating the context
|
||||
* across the application.
|
||||
*/
|
||||
tracer: Tracer<Context>;
|
||||
/**
|
||||
* Context manager instance
|
||||
*
|
||||
* The context manager is responsible for managing the context and propagating
|
||||
* it across the application.
|
||||
*/
|
||||
contextManager: ContextManager;
|
||||
/**
|
||||
* Meter instance (optional)
|
||||
*
|
||||
* The meter is responsible for creating and managing metrics instruments
|
||||
* such as counters, histograms, etc.
|
||||
*/
|
||||
meter?: Meter;
|
||||
}
|
||||
/**
|
||||
* Meter interface
|
||||
*
|
||||
* The meter is responsible for creating metric instruments.
|
||||
*/
|
||||
export interface Meter {
|
||||
/**
|
||||
* Creates a new Counter metric instrument.
|
||||
*
|
||||
* @param name - the name of the counter
|
||||
* @param options - optional configuration for the counter
|
||||
* @returns a Counter instance
|
||||
*/
|
||||
createCounter(name: string, options?: MetricOptions): Counter;
|
||||
/**
|
||||
* Creates a new Histogram metric instrument.
|
||||
*
|
||||
* @param name - the name of the histogram
|
||||
* @param options - optional configuration for the histogram
|
||||
* @returns a Histogram instance
|
||||
*/
|
||||
createHistogram(name: string, options?: MetricOptions): Histogram;
|
||||
/**
|
||||
* Creates a new Gauge metric instrument.
|
||||
*
|
||||
* A gauge is a metric that represents a single numerical value that can
|
||||
* arbitrarily go up and down. Gauges are typically used for measured values
|
||||
* like queue sizes.
|
||||
*
|
||||
* @param name - the name of the gauge
|
||||
* @param options - optional configuration for the gauge
|
||||
* @returns a Gauge instance
|
||||
*/
|
||||
createGauge(name: string, options?: MetricOptions): Gauge;
|
||||
}
|
||||
/**
|
||||
* Options for creating metric instruments
|
||||
*/
|
||||
export interface MetricOptions {
|
||||
/**
|
||||
* Human-readable description of the metric
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Unit of measurement for the metric (e.g., 'ms', 'bytes', '1')
|
||||
*/
|
||||
unit?: string;
|
||||
}
|
||||
/**
|
||||
* Counter metric interface
|
||||
*
|
||||
* A counter is a cumulative metric that represents a single monotonically
|
||||
* increasing value. Counters are typically used to count requests, completed
|
||||
* tasks, errors, etc.
|
||||
*/
|
||||
export interface Counter {
|
||||
/**
|
||||
* Adds a value to the counter.
|
||||
*
|
||||
* @param value - the value to add (must be non-negative)
|
||||
* @param attributes - optional attributes to associate with this measurement
|
||||
*/
|
||||
add(value: number, attributes?: Attributes): void;
|
||||
}
|
||||
/**
|
||||
* Histogram metric interface
|
||||
*
|
||||
* A histogram is a metric that samples observations and counts them in
|
||||
* configurable buckets. Typically used for measuring durations or sizes.
|
||||
*/
|
||||
export interface Histogram {
|
||||
/**
|
||||
* Records a value in the histogram.
|
||||
*
|
||||
* @param value - the value to record
|
||||
* @param attributes - optional attributes to associate with this measurement
|
||||
*/
|
||||
record(value: number, attributes?: Attributes): void;
|
||||
}
|
||||
/**
|
||||
* Gauge metric interface
|
||||
*
|
||||
* A gauge is a synchronous instrument which can be used to record
|
||||
* non-additive value(s) (e.g. the current queue size) when changes occur.
|
||||
*/
|
||||
export interface Gauge {
|
||||
/**
|
||||
* Records a value for the gauge.
|
||||
*
|
||||
* @param value - the value to record
|
||||
* @param attributes - optional attributes to associate with this measurement
|
||||
*/
|
||||
record(value: number, attributes?: Attributes): void;
|
||||
}
|
||||
/**
|
||||
* Context manager interface
|
||||
*
|
||||
* The context manager is responsible for managing the context and propagating
|
||||
* it across the application.
|
||||
*/
|
||||
export interface ContextManager<Context = any> {
|
||||
/**
|
||||
* Creates a new context and sets it as active for the fn passed as last argument
|
||||
*
|
||||
* @param context - the context to set as active
|
||||
* @param fn - the function to execute with the context
|
||||
*/
|
||||
with<A extends (...args: any[]) => any>(context: Context, fn: A): ReturnType<A>;
|
||||
/**
|
||||
* Returns the active context
|
||||
*/
|
||||
active(): Context;
|
||||
/**
|
||||
* Returns a serialized version of the current context. The metadata
|
||||
* is the mechanism used to propagate the context across a distributed
|
||||
* application.
|
||||
*
|
||||
* @param context - the current context
|
||||
*/
|
||||
getMetadata(context: Context): string;
|
||||
/**
|
||||
* Creates a new context from a serialized version effectively
|
||||
* linking the new context to the parent context.
|
||||
*
|
||||
* @param activeContext - the current active context
|
||||
* @param metadata - the serialized version of the context
|
||||
*/
|
||||
fromMetadata(activeContext: Context, metadata: string): Context;
|
||||
}
|
||||
/**
|
||||
* Tracer interface
|
||||
*
|
||||
*/
|
||||
export interface Tracer<Context = any> {
|
||||
/**
|
||||
* startSpan creates a new Span with the given name and options on an optional
|
||||
* context. If the context is not provided, the current active context should be
|
||||
* used.
|
||||
*
|
||||
* @param name - span name
|
||||
* @param options - span options
|
||||
* @param context - optional context
|
||||
* @returns - the created span
|
||||
*/
|
||||
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
||||
}
|
||||
export interface SpanOptions {
|
||||
kind: SpanKind;
|
||||
}
|
||||
/**
|
||||
* Span interface
|
||||
*/
|
||||
export interface Span<Context = any> {
|
||||
/**
|
||||
* setSpanOnContext sets the span on the context. This is useful when you want
|
||||
* to propagate the span across the application.
|
||||
*
|
||||
* @param ctx - context to set the span on
|
||||
* @returns - the context with the span set on it
|
||||
*/
|
||||
setSpanOnContext(ctx: Context): Context;
|
||||
/**
|
||||
* setAttribute sets an attribute on the span.
|
||||
*
|
||||
* @param key - attribute key
|
||||
* @param value - attribute value
|
||||
*/
|
||||
setAttribute(key: string, value: AttributeValue): void;
|
||||
/**
|
||||
* setAttributes sets multiple attributes on the span.
|
||||
*
|
||||
* @param attributes - attributes to set
|
||||
*/
|
||||
setAttributes(attributes: Attributes): void;
|
||||
/**
|
||||
* addEvent adds an event to the span.
|
||||
*
|
||||
* @param name - event name
|
||||
* @param attributes - event attributes
|
||||
*/
|
||||
addEvent(name: string, attributes?: Attributes): void;
|
||||
/**
|
||||
* recordException records an exception on the span.
|
||||
*
|
||||
* @param exception - exception to record
|
||||
* @param time - time to record the exception
|
||||
*/
|
||||
recordException(exception: Exception, time?: Time): void;
|
||||
/**
|
||||
* end ends the span.
|
||||
*
|
||||
* Note: spans must be ended so that they can be exported.
|
||||
*/
|
||||
end(): void;
|
||||
}
|
||||
export interface Attributes {
|
||||
[attribute: string]: AttributeValue | undefined;
|
||||
}
|
||||
export type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
||||
export type Exception = string | ExceptionType;
|
||||
export type ExceptionType = CodeException | MessageException | NameException;
|
||||
interface CodeException {
|
||||
code: string | number;
|
||||
name?: string;
|
||||
message?: string;
|
||||
stack?: string;
|
||||
}
|
||||
interface MessageException {
|
||||
code?: string | number;
|
||||
name?: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
}
|
||||
interface NameException {
|
||||
code?: string | number;
|
||||
name: string;
|
||||
message?: string;
|
||||
stack?: string;
|
||||
}
|
||||
export type Time = HighResolutionTime | number | Date;
|
||||
type HighResolutionTime = [number, number];
|
||||
export {};
|
||||
1
node_modules/bullmq/dist/esm/interfaces/telemetry.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/telemetry.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
151
node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts
generated
vendored
Normal file
151
node_modules/bullmq/dist/esm/interfaces/worker-options.d.ts
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
import { AdvancedOptions } from './advanced-options';
|
||||
import { KeyPrefixOptions, QueueBaseOptions } from './queue-options';
|
||||
import { RateLimiterOptions } from './rate-limiter-options';
|
||||
import { MetricsOptions } from './metrics-options';
|
||||
import { KeepJobs } from '../types/keep-jobs';
|
||||
import { Telemetry } from './telemetry';
|
||||
import { SandboxedOptions } from './sandboxed-options';
|
||||
export interface WorkerOptions extends QueueBaseOptions, SandboxedOptions, KeyPrefixOptions {
|
||||
/**
|
||||
* Optional worker name. The name will be stored on every job
|
||||
* processed by this worker instance, and can be used to monitor
|
||||
* which worker is processing or has processed a given job.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Condition to start processor at instance creation.
|
||||
*
|
||||
* @defaultValue true
|
||||
*/
|
||||
autorun?: boolean;
|
||||
/**
|
||||
* Amount of jobs that a single worker is allowed to work on
|
||||
* in parallel.
|
||||
*
|
||||
* @defaultValue 1
|
||||
* @see {@link https://docs.bullmq.io/guide/workers/concurrency}
|
||||
*/
|
||||
concurrency?: number;
|
||||
/**
|
||||
* Enable rate limiter
|
||||
* @see {@link https://docs.bullmq.io/guide/rate-limiting}
|
||||
*/
|
||||
limiter?: RateLimiterOptions;
|
||||
/**
|
||||
* Enable collect metrics.
|
||||
* @see {@link https://docs.bullmq.io/guide/metrics}
|
||||
*/
|
||||
metrics?: MetricsOptions;
|
||||
/**
|
||||
* Maximum time in milliseconds where the job is idle while being rate limited.
|
||||
* While workers are idle because of a rate limiter, they won't fetch new jobs to process
|
||||
* and delayed jobs won't be promoted.
|
||||
* @defaultValue 30000
|
||||
*/
|
||||
maximumRateLimitDelay?: number;
|
||||
/**
|
||||
* Defines the maximum number of times a job is allowed to start processing,
|
||||
* regardless of whether it completes or fails. Each time a worker picks up the job
|
||||
* and begins processing it, the attemptsStarted counter is incremented.
|
||||
* If this counter reaches maxStartedAttempts, the job will be moved to the failed state with an UnrecoverableError.
|
||||
* @defaultValue undefined
|
||||
*/
|
||||
maxStartedAttempts?: number;
|
||||
/**
|
||||
* Amount of times a job can be recovered from a stalled state
|
||||
* to the `wait` state. If this is exceeded, the job is moved
|
||||
* to `failed`.
|
||||
*
|
||||
* @defaultValue 1
|
||||
*/
|
||||
maxStalledCount?: number;
|
||||
/**
|
||||
* Number of milliseconds between stallness checks.
|
||||
*
|
||||
* @defaultValue 30000
|
||||
*/
|
||||
stalledInterval?: number;
|
||||
/**
|
||||
* You can provide an object specifying max
|
||||
* age and/or count to keep.
|
||||
* Default behavior is to keep the job in the completed set.
|
||||
*
|
||||
* Eviction is evaluated on a best-effort basis when a job finishes,
|
||||
* so aged jobs are only removed once another job completes after
|
||||
* their expiration.
|
||||
*/
|
||||
removeOnComplete?: KeepJobs;
|
||||
/**
|
||||
* You can provide an object specifying max
|
||||
* age and/or count to keep.
|
||||
* Default behavior is to keep the job in the failed set.
|
||||
*
|
||||
* Eviction is evaluated on a best-effort basis when a job fails, so
|
||||
* aged jobs are only removed once another job fails after their
|
||||
* expiration.
|
||||
*/
|
||||
removeOnFail?: KeepJobs;
|
||||
/**
|
||||
* Skip stalled check for this worker. Note that other workers could still
|
||||
* perform stalled checks and move jobs back to wait for jobs being processed
|
||||
* by this worker.
|
||||
*
|
||||
* @defaultValue false
|
||||
*/
|
||||
skipStalledCheck?: boolean;
|
||||
/**
|
||||
* Skip lock renewal for this worker. If set to true, the lock will expire
|
||||
* after lockDuration and moved back to the wait queue (if the stalled check is
|
||||
* not disabled)
|
||||
*
|
||||
* @defaultValue false
|
||||
*/
|
||||
skipLockRenewal?: boolean;
|
||||
/**
|
||||
* Number of seconds to long poll for jobs when the queue is empty.
|
||||
*
|
||||
* @defaultValue 5
|
||||
*/
|
||||
drainDelay?: number;
|
||||
/**
|
||||
* Duration of the lock for the job in milliseconds. The lock represents that
|
||||
* a worker is processing the job. If the lock is lost, the job will be eventually
|
||||
* be picked up by the stalled checker and move back to wait so that another worker
|
||||
* can process it again.
|
||||
*
|
||||
* @defaultValue 30000
|
||||
*/
|
||||
lockDuration?: number;
|
||||
/**
|
||||
* The time in milliseconds before the lock is automatically renewed.
|
||||
*
|
||||
* It is not recommended to modify this value, which is by default set to
|
||||
* half the lockDuration value, which is optimal for most use cases.
|
||||
*/
|
||||
lockRenewTime?: number;
|
||||
/**
|
||||
* This is an internal option that should not be modified.
|
||||
*
|
||||
* @defaultValue 15000
|
||||
*/
|
||||
runRetryDelay?: number;
|
||||
/**
|
||||
* More advanced options.
|
||||
*/
|
||||
settings?: AdvancedOptions;
|
||||
/**
|
||||
* Use Worker Threads instead of Child Processes.
|
||||
* Note: This option can only be used when specifying
|
||||
* a file for the processor argument.
|
||||
*
|
||||
* @defaultValue false
|
||||
*/
|
||||
useWorkerThreads?: boolean;
|
||||
/**
|
||||
* Telemetry Addon
|
||||
*/
|
||||
telemetry?: Telemetry;
|
||||
}
|
||||
export interface GetNextJobOptions {
|
||||
block?: boolean;
|
||||
}
|
||||
1
node_modules/bullmq/dist/esm/interfaces/worker-options.js
generated
vendored
Normal file
1
node_modules/bullmq/dist/esm/interfaces/worker-options.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in New Issue
Block a user