From 8644e0690acd2a6cf1de190ff87791f18b44bed0 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Wed, 19 Feb 2020 05:27:52 -0500 Subject: [PATCH 1/4] doc: add entry for `AsyncHook` class fixes: https://github.com/nodejs/node/issues/31661 --- doc/api/async_hooks.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 70c31c8a4239ab..90d9a2ccc3458b 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -76,6 +76,12 @@ function destroy(asyncId) { } // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ``` +### Class: `AsyncHook` + +The class `AsyncHook` exposes interface for tracking lifetime events +of asynchronous operations. Using a unique ID per asynchronous call, +it helps associating method calls that otherwise do not appear in a +typical call stack. #### `async_hooks.createHook(callbacks)` From 88cc03971cd9a811234892922ecfaf860fdbe8b2 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Thu, 20 Feb 2020 00:05:55 -0500 Subject: [PATCH 2/4] fixup: address review comment --- doc/api/async_hooks.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 90d9a2ccc3458b..d55c18ebedaa75 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -76,12 +76,6 @@ function destroy(asyncId) { } // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ``` -### Class: `AsyncHook` - -The class `AsyncHook` exposes interface for tracking lifetime events -of asynchronous operations. Using a unique ID per asynchronous call, -it helps associating method calls that otherwise do not appear in a -typical call stack. #### `async_hooks.createHook(callbacks)` @@ -176,6 +170,13 @@ provided by AsyncHooks itself. The logging should then be skipped when it was the logging itself that caused AsyncHooks callback to call. By doing this the otherwise infinite recursion is broken. +### Class: `AsyncHook` + +The class `AsyncHook` exposes interface for tracking lifetime events +of asynchronous operations. Using a unique ID per asynchronous call, +it helps associating method calls that otherwise do not appear together +in a typical call stack. + #### `asyncHook.enable()` * Returns: {AsyncHook} A reference to `asyncHook`. From 410b6e65fe1ca13d3b7a76aeb9120b04d0773936 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Fri, 21 Feb 2020 05:02:19 -0500 Subject: [PATCH 3/4] fixup: address review comments --- doc/api/async_hooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index d55c18ebedaa75..8b06e19dbd0900 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -172,9 +172,9 @@ doing this the otherwise infinite recursion is broken. ### Class: `AsyncHook` -The class `AsyncHook` exposes interface for tracking lifetime events +The class `AsyncHook` exposes an interface for tracking lifetime events of asynchronous operations. Using a unique ID per asynchronous call, -it helps associating method calls that otherwise do not appear together +it helps with associating method calls that otherwise do not appear together in a typical call stack. #### `asyncHook.enable()` From ed91f4c5f1fe139af418fac246f41f73811a8e93 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Mon, 9 Mar 2020 08:45:17 -0400 Subject: [PATCH 4/4] fixup: address review comment --- doc/api/async_hooks.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 8b06e19dbd0900..5e9f15857751ad 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -173,9 +173,7 @@ doing this the otherwise infinite recursion is broken. ### Class: `AsyncHook` The class `AsyncHook` exposes an interface for tracking lifetime events -of asynchronous operations. Using a unique ID per asynchronous call, -it helps with associating method calls that otherwise do not appear together -in a typical call stack. +of asynchronous operations. #### `asyncHook.enable()`