返回排行榜

taskforcesh/bullmq

TypeScriptbullmq.io

BullMQ - Message Queue and Batch processing for NodeJS, Python, Elixir and PHP based on Redis

background-jobsnodejsqueueredistypescriptpythonelixirphp
Star 增长趋势
Star
9.2k
Forks
655
周增长
Issues
274
5k
2019年8月2021年11月2024年3月2026年7月
制品库npmnpm install bullmq
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

Follow Us for *important* Bull/BullMQ/BullMQ-Pro news and updates!

🛠 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.

相关仓库
statelyai/xstate

State machines, statecharts, and actors for complex logic

TypeScriptnpmMIT Licensestate-machinestatechart
stately.ai/docs
29.9k1.4k
triggerdotdev/trigger.dev

Trigger.dev – build and deploy fully‑managed AI agents and workflows

TypeScriptnpmApache License 2.0automationorchestration
trigger.dev/changelog
15.7k1.4k
sidekiq/sidekiq

Simple, efficient background processing for Ruby

RubyRubyGemsOtherrubysidekiq
sidekiq.org
13.6k2.5k
hibiken/asynq

Simple, reliable, and efficient distributed task queue in Go

GoGo ModulesMIT Licensetask-queuego
13.5k971
rq/rq

Simple job queues for Python

PythonPyPIOtherredispython
python-rq.org
10.7k1.5k
HangfireIO/Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required

C#Otherdotnetdotnet-core
hangfire.io
10.1k1.8k
resque/resque

Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.

RubyRubyGemsMIT Licensequeuebackground-jobs
resque.github.io
9.5k1.7k
riverqueue/river

Fast and reliable background jobs in Go

GoGo ModulesMozilla Public License 2.0background-jobsgo
riverqueue.com
5.5k166
Evernote/android-job

Android library to handle jobs in the background.

JavaMavenApache License 2.0androidandroid-job
evernote.github.io/android-job/
5.4k554
jamesmh/coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!

C#MIT Licensedotnetcorebackground-jobs
docs.coravel.net/Installation/
4.3k270
svix/svix-webhooks

The open source and enterprise-ready webhooks service 🦀

Rustcrates.ioMIT Licensewebhooksrust
svix.com
3.3k262
shrinerb/shrine

File Attachment toolkit for Ruby applications

RubyRubyGemsMIT Licensefile-uploadruby
shrinerb.com
3.3k276