NestJS · Senior · Question 59 of 75
Why should long CPU-bound work not run in a Nest request handler?
- ✓Correct answer: Nest runs on one Node.js event loop; CPU work blocks all requests. Offload it to worker threads or a queue worker
- 2Handlers have a hard 1-second limit
- 3Nest automatically moves CPU work to threads
Explanation
Watch event loop delay; a single slow handler raises latency for everyone.