Ultimate Guide to Node.js Event Loop | Event Loop Detailed Explanation with Code Example

preview_player
Показать описание


Each phase of the event loop has a FIFO queue of callbacks to execute (timer have sorted heap). When the event loop enters a given phase, it will perform any operations specific to that phase, then execute callbacks in that phase's queue until the queue has been exhausted or the maximum number of callbacks has executed.

The different phases of the event loop include:
- **timers**: this phase executes callbacks scheduled by setTimeout() and setInterval().
- **I/O callbacks**: executes I/O callbacks deferred to the next loop iteration.
- **poll**: retrieve new I/O events; execute I/O related callbacks; node will block here when appropriate.
- **check**: setImmediate() callbacks are invoked here.

====== Development guides ======

====== opendevs Links ======

Рекомендации по теме
Комментарии
Автор

Oh how I wish my professor to explain this clearly ☹️🥺

patricksiemens