From f5e4443da190f772a3e39779ceaad5aa60525922 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Thu, 3 Feb 2022 11:49:34 +0100 Subject: [PATCH] doc: add note about resource type in async_hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41797 Reviewed-By: Stephen Belanger Reviewed-By: Darshan Sen Reviewed-By: Rich Trott Reviewed-By: Gerhard Stöbich Reviewed-By: Vladimir de Turckheim --- doc/api/async_hooks.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 3e47f366d74b5a..b74d52c5f8bcc5 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -329,6 +329,8 @@ The `type` is a string identifying the type of resource that caused `init` to be called. Generally, it will correspond to the name of the resource's constructor. +Valid values are: + ```text FSEVENTWRAP, FSREQCALLBACK, GETADDRINFOREQWRAP, GETNAMEINFOREQWRAP, HTTPINCOMINGMESSAGE, HTTPCLIENTREQUEST, JSSTREAM, PIPECONNECTWRAP, PIPEWRAP, PROCESSWRAP, QUERYWRAP, @@ -337,6 +339,9 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` +These values can change in any Node.js release. Furthermore users of [`AsyncResource`][] +likely provide other values. + There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them.