From 4db343bb8ee97f0ec513c0ae22ac0452f80916e6 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 516199f9391dae..1bdeb6e600a4cc 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.