node-resque implements distributed background jobs in Node with queues, workers, and a scheduler. It mirrors Resque and Sidekiq patterns using Redis for priority queues, delays, plugins, and failures.
Overview
node-resque is a TypeScript library that brings the Resque job-processing model to Node.js. Applications define job classes with perform handlers, enqueue work through a Queue client, and process tasks with Worker processes that poll Redis lists.
A Scheduler promotes delayed jobs when their timestamps arrive, and failed runs land in a dedicated failed queue for inspection, retry, or removal. Plugins can hook enqueue and perform stages for locking, retries, and similar cross-cutting behavior familiar from the Ruby ecosystem.
Redis 2.6.0 or newer is required because the implementation uses Lua scripts for atomic queue operations. Multiple workers and schedulers can run across hosts, with one scheduler elected leader. The package exposes events for successes, failures, polling, and stuck-worker cleanup, and documents patterns for cron-like scheduling using external schedulers alongside the built-in delay queue.
Key features
- Queue, Worker, and Scheduler classes
- Delayed jobs via enqueueIn and enqueueAt
- Failed job queue with retry helpers
- Resque-compatible Redis namespacing
- Worker plugins for locks and retries
- multiWorker for many workers per process
- Stuck worker detection and cleanup
- ioredis or custom Redis client support
Use cases
- Offloading slow tasks from a Node web app
- Running scheduled background work with Redis
- Mirroring Ruby Resque job semantics in Node
- Processing email, media, or import jobs asynchronously
- Operating prioritized worker pools per queue