ARCHOS 525 BLUEPRINT · /d/dgm_code-typescript-event-loop-and-microtasks
TypeScript / Node.js Event Loop, Microtasks & libuv Threadpool
6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_code-typescript-event-loop-and-microtasks) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-typescript-event-loop-and-microtasks)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-typescript-event-loop-and-microtasks" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="TypeScript / Node.js Event Loop, Microtasks & libuv Threadpool — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0["JS / TS Request"]
n1_1["V8 Call Stack"]
n2a_2[("Microtask Queue")]
n2b_3[("libuv Phase Queues")]
n3_4["libuv Worker Pool"]
downstream_5["Downstream & OTel"]
client_0 -->|"1. Push frame · V8"| n1_1
n1_1 -->|"2a. Drain 100% · Microtas"| n2a_2
n1_1 -->|"2b. IO · libuv"| n2b_3
n2a_2 -->|"3a. Thread · UV_POOL"| n3_4
n2b_3 -->|"3b. Merge · RAM"| n3_4
n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5COMPONENT STACK (6)
- JS / TS RequestSTATELESSAsync Promises & I/O
- V8 Call StackSTATELESSSingle-thread JS execution
- Microtask QueueSTATEFULPromise.then / queueMicrotask
- libuv Phase QueuesSTATEFULTimers, Poll & Check
- libuv Worker PoolSTATELESS4 threads for fs/dns/crypto
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- JS / TS Request → V8 Call Stack (Push frame)[V8]
- V8 Call Stack → Microtask Queue (Drain 100%)[Microtas]
- V8 Call Stack → libuv Phase Queues (IO)[libuv]
- Microtask Queue → libuv Worker Pool (Thread)[UV_POOL]
- libuv Phase Queues → libuv Worker Pool (Merge)[RAM]
- libuv Worker Pool → Downstream & OTel (Emit /)[OTLP/API]