Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

The Node.js Event Loop, Explained Simply (with Examples)

"Node.js is single-threaded" — you've heard it a hundred times. So how does it handle thousands of requests at once without freezing? The answer is the event loop .

  • Node.js is single-threaded but handles thousands of concurrent connections
  • Non-blocking code allows program to continue executing tasks while waiting for I/O operations
  • Event loop consists of Timers, Poll, Check, and Close phases with microtask queue draining

More from Wednesday 26 August →