BullRS
BullRS is a BullMQ compatible message queue for highly reliable job processing.
BullRS uses Redis to manage jobs in a highly reliable and scalable manner.
Distribute jobs across workers, with retrials, result values, inspecting logs per job and much more.
It's a great choice for distributed, event driven systems with fallible units of work.
BullRS is async and builds on the tokio runtime.
Priorities:
-
- Reliability - everything should work exactly as expected and no job should ever be lost
-
- Ease of use - beginner friendly, sensible defaults and hard to misuse API
-
- Performance - reduce round trips, maximize concurrence
The documentation is hosted on docs.rs/bullrs.
Example
use bullrs::deadpool_redis::{self, Pool, Runtime};
use bullrs::{JobOptions, ProgressPercent, Queue, QueueName, Worker, WorkerArgs};
let pool_config = Config::from_url("redis://127.0.0.1/");
let pool = pool_config.create_pool(None).unwrap();
let queue_name = QueueName::new("my-queue").unwrap();
let queue: Queue<i64, i64> = Queue::new(pool, queue_name);
queue.add("My Job", 123);
let worker = queue.worker();
// Job is Option<Result<Job, bullrs::BullrsError>>
let next_job = worker.next().await.unwrap().unwrap();
next_job.log_ts("Starting calculation...").await.unwrap();
next_job.
Features (WIP)
BullMQ has many features. The list below keeps track, which of them are imeplemented in BullRS:
- Managing Jobs
- Adding immediate Jobs, LIFO and FIFO
- Awaiting Job Results
- Remove Jobs
- Adding delayed Jobs
- Adding priority Jobs
- Repeatable Jobs
- Job Hiearchy
- Worker
- Dequeue immediate Jobs
- Requeue stalled jobs (e.g. worker went offline during processing)
- Retry jobs with backoff
- Repeatable Jobs
- Job Hiearchy
- Queue
- Pause / unpause entire queue
- Obliterate queue