Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dde8740

Browse filesBrowse files
GeoffreyBoothdanielleadams
authored andcommitted
doc: add async_hooks migration note
PR-URL: #45335 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 7984e06 commit dde8740
Copy full SHA for dde8740

File tree

Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/async_hooks.md‎

Copy file name to clipboardExpand all lines: doc/api/async_hooks.md
+14-1Lines changed: 14 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
<!--introduced_in=v8.1.0-->
44

5-
> Stability: 1 - Experimental
5+
> Stability: 1 - Experimental. Please migrate away from this API, if you can.
6+
> We do not recommend using the [`createHook`][], [`AsyncHook`][], and
7+
> [`executionAsyncResource`][] APIs as they have usability issues, safety risks,
8+
> and performance implications. Async context tracking use cases are better
9+
> served by the stable [`AsyncLocalStorage`][] API. If you have a use case for
10+
> `createHook`, `AsyncHook`, or `executionAsyncResource` beyond the context
11+
> tracking need solved by [`AsyncLocalStorage`][] or diagnostics data currently
12+
> provided by [Diagnostics Channel][], please open an issue at
13+
> <https://github.com/nodejs/node/issues> describing your use case so we can
14+
> create a more purpose-focused API.
615
716
<!-- source_link=lib/async_hooks.js -->
817

@@ -869,14 +878,18 @@ The documentation for this class has moved [`AsyncResource`][].
869878
The documentation for this class has moved [`AsyncLocalStorage`][].
870879
871880
[DEP0111]: deprecations.md#dep0111-processbinding
881+
[Diagnostics Channel]: diagnostics_channel.md
872882
[Hook Callbacks]: #hook-callbacks
873883
[PromiseHooks]: https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk/edit
884+
[`AsyncHook`]: #class-asynchook
874885
[`AsyncLocalStorage`]: async_context.md#class-asynclocalstorage
875886
[`AsyncResource`]: async_context.md#class-asyncresource
876887
[`Worker`]: worker_threads.md#class-worker
877888
[`after` callback]: #afterasyncid
878889
[`before` callback]: #beforeasyncid
890+
[`createHook`]: #async_hookscreatehookcallbacks
879891
[`destroy` callback]: #destroyasyncid
892+
[`executionAsyncResource`]: #async_hooksexecutionasyncresource
880893
[`init` callback]: #initasyncid-type-triggerasyncid-resource
881894
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
882895
[`promiseResolve` callback]: #promiseresolveasyncid

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.