Node.js TutorialLesson 9Free preview
Node Event Loop
This lesson is part of Node.js · All levels
Summary
Event loops are mechanisms that enable multiple asynchronous operations to be handled in a single thread. It keeps spinning checking the task queue: from the timer, I/O callback, to the Promise microtask. That's why slow synchronous code can block an entire application. (Node.js)
Key points
- The event loop rotates continuously as long as there's still work on the queue
- The main phases include timers, pending callbacks, polling, check (setImmediate), and close
- The Microtask Promise (then/catch) is executed immediately after the callback is complete
- Blocking the event loop makes the entire server feel slow.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.