What problem does it solve?
This Skill provides a structured approach to implementing and orchestrating background jobs in Node.js using BullMQ and Redis. It enables defining typed job payloads, building deterministic workers, and managing retries and failure handling to keep user-facing systems responsive.
Core Features & Use Cases
- Job type definition: Define typed payloads and a consistent interface for data.
- Queue workers: Create workers that process specific job types with deterministic behavior.
- Retry & DLQ: Implement exponential backoff retry strategies and a dead-letter queue for failed jobs.
- Observability: Instrument metrics to monitor queue depth, active jobs, and failures.
- Use Case: Async tasks like image processing, notifications, or data enrichment can be offloaded to background workers to improve responsiveness.
Quick Start
Start the queue system and enqueue a sample job. Example: queue.add('my-job-type', { workspaceId: 'ws-1', userId: 'user-1', payload: {} }, { attempts: 3, backoff: { type: 'exponential', delay: 2000 } });