The event loop fairytale
summary
A concrete map of Node.js internals: callbacks pass through named event loop phases, CPU/IO offloads to libuv elves backed by a default thread pool (4 threads), promises and process.nextTick run as microtasks after each phase, and timers vs setImmediate behave in their specific phases (setImmediate is not actually immediate). A synchronous 2MB file read blocks the loop for a long time; worker threads or libuv offload prevent that.
AI-written summary · about
chapters (19)
- 0:00Event loop fairytale
- 1:08Why it matters
- 2:10Block and early kingdoms
- 4:36Land of promises
- 6:41Villagers in promises
- 8:05Sir Kastak and Fairy
- 10:16Never block the thread
- 12:44Desert of asynchrony
- 14:11Thread pools and libuv
- 17:23Callbacks return to stack
- 19:13Menacing dragon of blocks
- 20:37Six phases of event loop
- 23:45Power of process.nextTick
- 25:30Why some phases matter more than others
- 26:36Event loop challenge
- 27:20Strength in mind and time
- 28:03Birdie and tech for good
- 29:10Goang threads and conclusion
- 30:36Questions and answers session








