Norint tvarkyti foninį darbą (darbą, kuris neturėtų blokuoti HTTP atsakymą), NestJS integruojasi su BullMQ (Redis paremta eile) per @nestjs/bullmq. Jūs pridediate darbus į eilę ir juos apdorojate asinchroniškai atskiruose darbininkuose — palaikydami greitą užklausų atsakymą ir patikimai tvarkytiindami sunkų arba atidėtą darbą.
Problema, kurią sprendžia eilės
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
