# Mission: BullMQ with TypeScript

## Why
Ship reliable background-job infrastructure in a production TypeScript codebase — emails, webhooks, image processing, scheduled tasks — without dropping work or paging the on-call at 3am. BullMQ is the tool; the real goal is confidence operating async workloads on Redis.

## Success looks like
- [ ] Explain BullMQ architecture and how it uses Redis (queue, worker, job, events)
- [ ] Implement a basic job queue with producers and workers in TypeScript
- [ ] Handle retries, exponential backoff, and failed-job (dead-letter) patterns
- [ ] Implement job scheduling (delayed + recurring/cron)
- [ ] Add priority queues and rate limiting
- [ ] Monitor queue health (metrics, stalled jobs, cleanup)
- [ ] Deploy and operate in production (connection pooling, graceful shutdown, scaling workers)

## Constraints
- Lessons must be practical and tied to real production patterns
- Each lesson completable in 15–30 minutes
- Reference documents serve as quick lookup for syntax/API
- Prefer official BullMQ docs and Redis docs as primary sources
- TypeScript end-to-end (typed jobs, typed worker handlers)

## Out of scope
- Bull v3 / legacy Bull (only BullMQ v5+)
- Non-Redis queue systems (SQS, RabbitMQ) except brief comparison
- Redis internals beyond what BullMQ requires
