types
BackoffStrategy
Defines the backoff strategy used when retrying failed jobs. Returns the delay in ms that should pass before the failed job is retried.
Signature
type BackoffStrategy = (queueName: string, attemptsMade: number, job: Job) => number
JobUpdate
Job update status as returned from the SubscribableJob’s update()
method.
Signature
type JobUpdate<T extends JobData<T>> = Pick<
Job<T>,
'id' | 'state' | 'progress' | 'result' | 'error' | 'data'
>
JobUpdateOptions
Job update options, that you can specify by calling {@link SubscribableJob.updates updates()} method.
Signature
type JobUpdateOptions = {
pollInterval?: number;
timeoutMs?: number;
errorOnFail?: boolean;
}
Members
pollInterval
number
timeoutMs
number
errorOnFail
boolean
CreateQueueOptions
Used to configure a new JobQueue instance.
Signature
interface CreateQueueOptions<T extends JobData<T>> {
name: string;
process: (job: Job<T>) => Promise<any>;
}
Members
name
string
process
(job: Job<T>) => Promise<any>
JobData
A JSON-serializable data type which provides a Job with the data it needs to be processed.
Signature
type JobData<T> = JsonCompatible<T>
JobConfig
Used to instantiate a new Job
Signature
interface JobConfig<T extends JobData<T>> {
queueName: string;
data: T;
retries?: number;
attempts?: number;
id?: ID;
state?: JobState;
progress?: number;
result?: any;
error?: any;
createdAt?: Date;
startedAt?: Date;
settledAt?: Date;
}
Members
queueName
string
data
T
retries
number
attempts
number
id
ID
state
JobState
progress
number
result
any
error
any
createdAt
Date
startedAt
Date
settledAt
Date