MCPcopy Index your code
hub / github.com/taskforcesh/bullmq

github.com/taskforcesh/bullmq @v5.79.2 sqlite

repository ↗ · DeepWiki ↗ · release v5.79.2 ↗
1,485 symbols 5,485 edges 231 files 344 documented · 23% 29 cross-repo links
README

The fastest, most reliable, Redis-based distributed queue for Node.js, Python, Rust, and more.


Carefully written for rock solid stability and atomicity.

Read the documentation

<a href="https://join.slack.com/t/bullmq/shared_invite/zt-1nbtpk6mv-TItWpF9jf3k4yrCaS0PPZA">
  <img src="https://img.shields.io/badge/Slack-4A154B"/>
</a>    
<a href="https://badge.fury.io/js/bullmq">
  <img src="https://badge.fury.io/js/bullmq.svg"/>
</a>
<a href="https://coveralls.io/github/taskforcesh/bullmq?branch=master">
  <img src="https://coveralls.io/repos/github/taskforcesh/bullmq/badge.svg?branch=master"/>
</a>
<a href="https://github.com/semantic-release/semantic-release">
  <img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"/>
</a>
<a href="https://github.com/sponsors/taskforcesh">
  <img src="https://img.shields.io/badge/sponsor-30363D?style=flat&logo=GitHub-Sponsors&logoColor=EA4AAA"/>
</a>






<em><a href="https://x.com/bullmqhq">Follow Us</a> for *important* Bull/BullMQ/BullMQ-Pro news and updates!</em>

🛠 Tutorials

You can find tutorials and news in this blog: https://blog.taskforce.sh/

News 🚀

🌐 Language agnostic BullMQ

BullMQ is available natively in multiple languages:

  • Node.js / Bun — This repository (npm install bullmq)
  • Pythonpython/ directory (pip install bullmq)
  • Rustrust/ directory (cargo add bullmq)
  • Elixirelixir/ directory ({:bullmq, "~> x.x"})
  • PHPphp/ directory

For other platforms, check out the BullMQ Proxy.

Official FrontEnd

Taskforce.sh, Inc

Supercharge your queues with a professional front end:

  • Get a complete overview of all your queues.
  • Inspect jobs, search, retry, or promote delayed jobs.
  • Metrics and statistics.
  • and many more features.

Sign up at Taskforce.sh

🚀 Sponsors 🚀

Dragonfly Dragonfly is a new Redis™ drop-in replacement that is fully compatible with BullMQ and brings some important advantages over Redis™ such as massive better performance by utilizing all CPU cores available and faster and more memory efficient data structures. Read more here on how to use it with BullMQ.

Used by

Some notable organizations using BullMQ:

Microsoft Vendure Datawrapper Nest Langfuse
Curri Novu NoCodeDB Infisical

The gist

Install:

$ yarn add bullmq

If you use the node-redis adapter (createNodeRedisClient), install redis v5 or newer (redis >= 5.0.0).

Add jobs to the queue:

import { Queue } from 'bullmq';

const queue = new Queue('Paint');

queue.add('cars', { color: 'blue' });

Process the jobs in your workers:

import { Worker } from 'bullmq';

const worker = new Worker('Paint', async job => {
  if (job.name === 'cars') {
    await paintCar(job.data.color);
  }
});

Listen to jobs for completion:

import { QueueEvents } from 'bullmq';

const queueEvents = new QueueEvents('Paint');

queueEvents.on('completed', ({ jobId }) => {
  console.log('done painting');
});

queueEvents.on(
  'failed',
  ({ jobId, failedReason }: { jobId: string; failedReason: string }) => {
    console.error('error painting', failedReason);
  },
);

Adds jobs with parent-child relationship:

import { FlowProducer } from 'bullmq';

const flow = new FlowProducer();

const originalTree = await flow.add({
  name: 'root-job',
  queueName: 'topQueueName',
  data: {},
  children: [
    {
      name: 'child-job',
      data: { idx: 0, foo: 'bar' },
      queueName: 'childrenQueueName',
      children: [
        {
          name: 'grandchild-job',
          data: { idx: 1, foo: 'bah' },
          queueName: 'grandChildrenQueueName',
        },
        {
          name: 'grandchild-job',
          data: { idx: 2, foo: 'baz' },
          queueName: 'grandChildrenQueueName',
        },
      ],
    },
    {
      name: 'child-job',
      data: { idx: 3, foo: 'foo' },
      queueName: 'childrenQueueName',
    },
  ],
});

This is just scratching the surface, check all the features and more in the official documentation

Feature Comparison

Since there are a few job queue solutions, here is a table comparing them:

Feature BullMQ-Pro BullMQ Bull Kue Bee Agenda
Backend redis redis redis redis redis mongo
Observables
Group Rate Limit
Group Support
Batches Support
Parent/Child Dependencies
Deduplication (Debouncing)
Deduplication (Throttling)
Priorities
Concurrency
Delayed jobs
Global events
Rate Limiter
Pause/Resume
Sandboxed worker
Repeatable jobs
Atomic ops
Persistence
UI
Optimized for Jobs / Messages Jobs / Messages Jobs / Messages Jobs Messages Jobs

Contributing

Fork the repo, make some changes, submit a pull-request! Here is the contributing doc that has more details.

Thanks

Thanks for all the contributors that made this library possible, also a special mention to Leon van Kammen that kindly donated his npm bullmq repo.

Extension points exported contracts — how you extend this code

Counter (Interface)
(no doc) [7 implementers]
src/interfaces/telemetry.ts
ClusterNodeWithClientCommand (Interface)
(no doc) [3 implementers]
src/classes/queue-getters.ts
procSendLike (Interface)
(no doc)
src/utils/index.ts
Command (Interface)
(no doc)
src/commands/script-loader.ts
CustomListener (Interface)
(no doc)
tests/events.test.ts
ConnectionFactoryOpts (Interface)
(no doc)
tests/utils/connection-factory.ts
IConnection (Interface)
(no doc) [4 implementers]
src/interfaces/connection.ts
RedisCapabilities (Interface)
(no doc)
src/classes/redis-connection.ts

Core symbols most depended-on inside this repo

close
called by 1017
src/classes/bun-redis-client.ts
add
called by 785
src/interfaces/telemetry.ts
on
called by 535
src/interfaces/redis-client.ts
waitUntilReady
called by 510
src/interfaces/connection.ts
delay
called by 417
src/utils/index.ts
get
called by 242
src/interfaces/redis-client.ts
push
called by 187
src/classes/async-fifo-queue.ts
randomUUID
called by 162
src/utils/index.ts

Shape

Method 1,103
Function 141
Class 135
Interface 86
Enum 12
Route 8

Languages

TypeScript73%
Python27%

Modules by API surface

src/classes/node-redis-client.ts140 symbols
src/classes/bun-redis-client.ts88 symbols
src/classes/scripts.ts85 symbols
src/classes/job.ts62 symbols
src/interfaces/redis-client.ts57 symbols
python/bullmq/scripts.py57 symbols
src/classes/worker.ts50 symbols
src/classes/queue.ts49 symbols
src/classes/queue-getters.ts46 symbols
python/bullmq/queue.py42 symbols
python/tests/queue_test.py38 symbols
python/tests/worker_test.py37 symbols

Dependencies from manifests, versioned

predis/predis2.0 · 1×
ramsey/uuid4.7 · 1×
rybakit/msgpack0.9 · 1×
@commitlint/cli21.0.2 · 1×
@commitlint/config-conventional21.0.2 · 1×
@semantic-release/changelog6.0.3 · 1×
@semantic-release/commit-analyzer13.0.1 · 1×
@semantic-release/exec7.1.0 · 1×
@semantic-release/git10.0.1 · 1×
@semantic-release/npm13.1.5 · 1×
@semantic-release/release-notes-generator14.1.1 · 1×

For agents

$ claude mcp add bullmq \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact