Node.js · Middle · Question 4 of 75
Why can recursive process.nextTick calls be dangerous?
- ✓Correct answer: The nextTick queue is drained completely before the loop continues, so endless nextTicks starve I/O
- 2Node.js limits nextTick to 10 calls and then throws
- 3nextTick callbacks run in a separate thread and can corrupt memory
Explanation
The same applies to an endless chain of microtasks. setImmediate lets the event loop process I/O between iterations.