Module 12 · Async 1: Callbacks and the Event Loop
Every Piece of the Async Toolkit: Timers, Clearing, Microtasks and Callback Shapes
Free with an accountReading
Nadia is building a small reminder tool for her team. A reminder must fire once after a delay, a clock must tick every second, and a "cancel" button must stop either one. A file read must report either an error or the data, never both.
Checking what this lesson needs for you…
What is inside Every Piece of the Async Toolkit: Timers, Clearing, Microtasks and Callback Shapes
- A callback is a function you hand over
- setTimeout: not before, never exactly
- The zero delay and Node's 1 ms floor
- clearTimeout cancels a waiting timer
- setInterval and clearInterval
- Extra arguments after the delay
- queueMicrotask
- The error-first callback
- A callback is called once
- Timers inside timers
- When does my callback run?