-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
docs: documenting async hooks features #12953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,12 @@ | ||
| # Async Hooks | ||
|
|
||
|
|
||
| > Stability: 2 - Stable | ||
| > Stability: 1 - Experimental | ||
|
|
||
|
|
||
| The `async-hooks` module provides an API to register callbacks tracking the | ||
| lifetime of asynchronous resources created inside a Node.js application. | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please include something like: |
||
| At its simplest form it can track metadata about each resource and log it when | ||
| the program exits. | ||
|
|
||
| ## Terminology | ||
|
|
||
| An async resource represents either a "handle" or a "request". | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than the quotes, make these italic. e.g. handle or a request |
||
|
|
@@ -249,19 +246,26 @@ Output from only starting the server: | |
|
|
||
| ``` | ||
| TCPWRAP(2): trigger: 1 scope: 1 | ||
| # .listen() | ||
| TickObject(3): trigger: 1 scope: 1 | ||
| TickObject(3): trigger: 2 scope: 1 | ||
| before: 3 | ||
| Timeout(4): trigger: 3 scope: 3 | ||
| TIMERWRAP(5): trigger: 3 scope: 3 | ||
| after: 3 | ||
| destroy: 3 | ||
| before: 5 | ||
| before: 4 | ||
| TTYWRAP(6): trigger: 4 scope: 4 | ||
| SIGNALWRAP(7): trigger: 4 scope: 4 | ||
| TTYWRAP(8): trigger: 4 scope: 4 | ||
| >>> 4 | ||
| TickObject(9): trigger: 4 scope: 4 | ||
| after: 4 | ||
| destroy: 4 | ||
| after: 5 | ||
| before: 9 | ||
| after: 9 | ||
| destroy: 9 | ||
| destroy: 5 | ||
| ``` | ||
|
|
||
| First notice that `scope` and the value returned by `currentId()` are always | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the extra blank lines in here