للمهام الخلفية (Background jobs) (العمل الذي لا يجب أن يحجب استجابة HTTP)، يتكامل NestJS مع BullMQ (رتل مدعوم بـ Redis) عبر @nestjs/bullmq. تضيف مهام إلى رتل ومعالجتها بشكل غير متزامن في عمال منفصلين — مما يحافظ على سرعة الطلبات ويتعامل مع العمل الثقيل أو المؤجل بشكل موثوق.
المشكلة التي تحلها الرتل
Some work is too slow or shouldn't block the request:
✗ sending emails, processing images/video, generating reports, calling slow APIs
→ doing it inline makes the user wait and risks timeouts/failures
✓ QUEUE the work → respond immediately → a worker processes it in the background
