ਬੈਕਗ੍ਰਾਉਂਡ ਜੌਬਸ (ਅਜਿਹਾ ਕਾਰਜ ਜੋ 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
