The Birth and Evolution of AsyncHooks
summary
Module lands in Node 8 after a four‑year evolution (first commit Sept 2013, removed Dec 2014, async_hooks PR Sept 2016, landed Mar 2017). It exposes init/before/after/destroy hooks, adds executionAsyncId and triggerAsyncId to track causal chains, and gains full promise integration plus a promise‑resolver hook. Design choices: numeric unique IDs, C++ and runtime‑agnostic APIs, shared typed‑array state between C++ and JS to avoid VM roundtrips, removal of global exception‑handling and per‑path tracing for performance and safety.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:04how it all began
- 1:38birth of AsyncListener
- 6:55back to AsyncListener
- 9:41more on AsyncListener
- 13:06and it all goes away
- 14:45slow but steady
- 19:33arrival of async_hooks
- 25:00asynchronous events
- 25:53why exception handling was removed
- 26:54execution and trigger async ids
- 28:47AsyncResource and static API
- 29:31Promise integration
related talks
12m600 Seconds on async_hooks
28mGrokking Asynchronous Work in Node.js
30mNode.js: What's Next?
35mFun with async hooks and stack traces
14mThe Promised Path to Async, Awaits
32mThe Evolution Of Asynchronous Javascript
40mNode.js: Where are we now, where are we going?
25mThe Long Road to Async/Await in JavaScript
