CHAPTER 07

Async Patterns & Control Flow

Every subchapter in this chapter, free to read online. Work through them in order, or jump straight to the runtime detail you need.

07
chapter
6
subchapters
Free
online
01
Subchapter

Error-First Callbacks

How Node.js error-first callbacks work, why the first argument carries errors, and how callback dispatch connects native async work back to JavaScript.

02
Subchapter

Promise Microtasks

How Node.js orders Promise jobs, process.nextTick callbacks, queueMicrotask work, timers, and I/O across CommonJS, ES modules, and active microtask drains.

03
Subchapter

Async/Await

How async functions and await work in Node.js through promise wrapping, suspension, resumption, microtasks, errors, and V8 state machines.

04
Subchapter

EventEmitter Internals

How EventEmitter stores listeners, dispatches emit synchronously, handles error events, preserves listener order, and reports possible leaks.

05
Subchapter

Async Iterators

How async iterators work in Node.js through Symbol.asyncIterator, for await...of, async generators, stream consumption, and backpressure.

06
Subchapter

Promise Combinators

How Promise.all, allSettled, race, and any behave in Node.js, including short-circuiting, failure propagation, cancellation gaps, and concurrency limits.

Other chapters

13 more