Skip to content

LvivNodeJsClub/node-js-event-loop

Repository files navigation

The Node.js Event Loop, Timers, and process.nextTick()

Event Loop phases

Phases Overview

  • timers: this phase executes callbacks scheduled by setTimeout() and setInterval().
  • pending callbacks: executes I/O callbacks deferred to the next loop iteration.
  • idle, prepare: only used internally.
  • poll: retrieve new I/O events; execute I/O related callbacks (almost all with the exception of close callbacks, the ones scheduled by timers, and setImmediate()); node will block here when appropriate.
  • check: setImmediate() callbacks are invoked here.
  • close callbacks: some close callbacks, e.g. socket.on('close', ...).

Links

About

The Node.js Event Loop, Timers, and process.nextTick() examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published