From 385ddae6baccb77d8739dded85ee57e57f8b3c59 Mon Sep 17 00:00:00 2001 From: tony-go Date: Mon, 31 Jan 2022 21:15:15 +0100 Subject: [PATCH 1/5] doc: add note about resource type in async_hooks --- doc/api/async_hooks.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 516199f9391dae..39189ddb31722f 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. +Here is a list of potential _identifiers_: + ```text FSEVENTWRAP, FSREQCALLBACK, GETADDRINFOREQWRAP, GETNAMEINFOREQWRAP, HTTPINCOMINGMESSAGE, HTTPCLIENTREQUEST, JSSTREAM, PIPECONNECTWRAP, PIPEWRAP, PROCESSWRAP, QUERYWRAP, @@ -337,6 +339,8 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` +**Note**: you should not rely too much on these _identifiers_ as they could arbitrarily change. + There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them. From e1aff5c1c103821c6502e989698145dbfa5db50e Mon Sep 17 00:00:00 2001 From: tony-go Date: Mon, 31 Jan 2022 21:57:32 +0100 Subject: [PATCH 2/5] doc: lint file --- doc/api/async_hooks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 39189ddb31722f..5bbd32c259f2c0 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -339,7 +339,8 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` -**Note**: you should not rely too much on these _identifiers_ as they could arbitrarily change. +**Note**: you should not rely too much on these _identifiers_ +as they could arbitrarily change. There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them. From bac310c9be0debe2cb16543ce871a2e10bbe35dc Mon Sep 17 00:00:00 2001 From: tony-go Date: Tue, 1 Feb 2022 21:49:30 +0100 Subject: [PATCH 3/5] doc: fix note about resource type --- doc/api/async_hooks.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 5bbd32c259f2c0..61636471fa0069 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -329,7 +329,7 @@ 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. -Here is a list of potential _identifiers_: +Valid values are: ```text FSEVENTWRAP, FSREQCALLBACK, GETADDRINFOREQWRAP, GETNAMEINFOREQWRAP, HTTPINCOMINGMESSAGE, @@ -339,8 +339,7 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` -**Note**: you should not rely too much on these _identifiers_ -as they could arbitrarily change. +**Note**: These values can change in any Node.js release. There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them. From b2622ce5a6f80ca015e2745770da7896d32c5aa1 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Wed, 2 Feb 2022 06:23:40 +0100 Subject: [PATCH 4/5] doc: delete useless note makrer Co-authored-by: Rich Trott --- doc/api/async_hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 61636471fa0069..932ad7488c8a1b 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -339,7 +339,7 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` -**Note**: These values can change in any Node.js release. +These values can change in any Node.js release. There is also the `PROMISE` resource type, which is used to track `Promise` instances and asynchronous work scheduled by them. From 95e13497425db49d95006330ebac4e4386308dc6 Mon Sep 17 00:00:00 2001 From: tony-go Date: Wed, 2 Feb 2022 19:48:27 +0100 Subject: [PATCH 5/5] doc: add note details --- doc/api/async_hooks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 932ad7488c8a1b..1bdeb6e600a4cc 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -339,7 +339,8 @@ TTYWRAP, UDPSENDWRAP, UDPWRAP, WRITEWRAP, ZLIB, SSLCONNECTION, PBKDF2REQUEST, RANDOMBYTESREQUEST, TLSWRAP, Microtask, Timeout, Immediate, TickObject ``` -These values can change in any Node.js release. +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.