🇬🇧 English
🇧🇬 Български
⚡ Event Loop — Live Visualization
🌐 Browser
🟢 Node.js
▶ Run
■ Stop
⏸ Pause
🐢
⚡
Ready to start.
Press ▶ Run to execute the code on the left.
🎡 Event Loop — Live
⌄
⏭ UP NEXT
— no scheduled tasks —
❓ WHY NOW?
—
READY
Call Stack
empty
📝 Code (editable)
🖥️ Console
0
Call Stack
0
— empty —
Microtask Queue
0
— empty —
Task Queues
0
— empty —
Web APIs (timers waiting)
0
— no waiting timers —
🔁 Event Loop phases (libuv)
1
⏰ timers
setTimeout / setInterval
2
📨 pending
deferred I/O callbacks
3
🌀 idle, prepare
internal to Node only
4
📡 poll
I/O callbacks
5
✅ check
setImmediate()
6
🔒 close callbacks
e.g. socket.on('close')
process.nextTick()
0
— empty —
Microtask (Promise)
0
— empty —
Outside the event loop (timers / simulated I/O)
0
— no pending operations —
ℹ️ Browser model — how do I read this?
⌄
ℹ️ Node.js model — how do I read this?
⌄
🚀 Express.js — Concurrent Requests
⌄
3 parallel async requests
⚠ CPU-blocking example
🔀 Alternate automatically
▶ Play
↻ Restart
🐢
⚡
3 parallel async requests
—
Clients
→
Express + JS Thread
IDLE
⏳ Waiting (I/O)
—
✅ Ready
—
▶ WHAT'S HAPPENING NOW?
Starting…
❓ WHY CAN ANOTHER REQUEST RUN?
—
📄 HANDLER CODE —
—
JS Thread
— never overlaps
Async / I/O
— can overlap
by Kiril Kirkov