Skip to content

Latest commit

 

History

History
122 lines (107 loc) · 6.77 KB

bullmq.md

File metadata and controls

122 lines (107 loc) · 6.77 KB

Home > bullmq

bullmq package

Classes

Class Description
Backoffs
ChildPool
FlowProducer This class allows to add jobs with dependencies between them in such a way that it is possible to build complex flows. Note: A flow is a tree-like structure of jobs that depend on each other. Whenever the children of a given parent are completed, the parent will be processed, being able to access the children's result data. All Jobs can be in different queues, either children or parents,
Job
Queue QueueThis class provides methods to add jobs to a queue and some othe high-level administration such as pausing or deleting queues.
QueueBase
QueueEvents The QueueEvents class is used for listening to the global events emitted by a given queue.This class requires a dedicated redis connection.
QueueGetters
QueueScheduler This class is just used for some automatic bookkeeping of the queue, such as updating the delay set as well as moving stalled jobs back to the waiting list.Jobs are checked for stallness once every "visibility window" seconds. Jobs are then marked as candidates for being stalled, in the next check, the candidates are marked as stalled and moved to wait. Workers need to clean the candidate list with the jobs that they are working on, failing to update the list results in the job ending being stalled.This class requires a dedicated redis connection, and at least one is needed to be running at a given time, otherwise delays, stalled jobs, retries, repeatable jobs, etc, will not work correctly or at all.
RedisConnection
Repeat
ScriptLoader Lua script loader with include support
ScriptLoaderError
Scripts
Worker_2 This class represents a worker that is able to process jobs from the queue. As soon as the class is instantiated it will start processing jobs.

Enumerations

Enumeration Description
ChildCommand
ClientType
ErrorCodes
ParentCommand

Functions

Function Description
array2obj(arr)
delay(ms)
getParentKey(opts)
isEmpty(obj)
isNotConnectionError(error)
isRedisInstance(obj)
jobIdForGroup(jobOpts, data, queueOpts)
lengthInUtf8Bytes(str) Checks the size of string for ascii/non-ascii characters
raw2jobData(raw)
removeAllQueueData(client, queueName, prefix)
tryCatch(fn, ctx, args)

Interfaces

Interface Description
AddChildrenOpts
AddNodeOpts
AdvancedOptions
BackoffOptions Settings for backing off failed jobs.
ChildMessage
ChildProcessExt
Command
DependenciesOpts
FlowJob
FlowOpts
GetNextJobOptions
IConnection
JobJson
JobJsonRaw
JobNode
JobsOptions
MoveToChildrenOpts
NodeOpts
Parent Describes the parent for a Job.
ParentMessage
QueueBaseOptions Base Queue options
QueueDeclaration
QueueEventsListener
QueueEventsOptions Options for QueueEvents
QueueOptions Options for the Queue class.
QueueSchedulerDeclaration
QueueSchedulerOptions Options for customizing the behaviour of the scheduler.
RateLimiterOptions
RepeatOptions Settings for repeatable jobs
SandboxedJob
ScriptMetadata Script metadata
Strategies
WorkerDeclaration
WorkerOptions_2

Variables

Variable Description
childSend
clientCommandMessageReg
DELAY_TIME_1
DELAY_TIME_5
errorObject
parentSend
scriptLoader

Type Aliases

Type Alias Description
BackoffFunction
BulkJobOptions
ConnectionOptions
EntryId
EntryRaw
FlowQueuesOpts
JobData
MinimalQueue
ParentOpts
Processor An async function that receives Jobs and handles them.
RedisClient
RedisOptions
SandboxedJobProcessor
StreamName
StreamReadRaw