We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7394311 commit 63d978cCopy full SHA for 63d978c
doc/api/async_hooks.md
@@ -973,6 +973,11 @@ chains. It allows storing data throughout the lifetime of a web request
973
or any other asynchronous duration. It is similar to thread-local storage
974
in other languages.
975
976
+While you can create your own implementation on top of the `async_hooks` module,
977
+`AsyncLocalStorage` should be preferred as it is a performant and memory safe
978
+implementation that involves significant optimizations that are non-obvious to
979
+implement.
980
+
981
The following example uses `AsyncLocalStorage` to build a simple logger
982
that assigns IDs to incoming HTTP requests and includes them in messages
983
logged within each request.
0 commit comments