GeezerVison is showing github.com — doc: explain Worker semantics in async_hooks.md · nodejs/node@6caa354
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/async_hooks.md +5-1Lines changed: 5 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,9 @@ A resource can also be closed before the callback is called. `AsyncHook` does |
21 | 21 | not explicitly distinguish between these different cases but will represent them |
22 | 22 | as the abstract concept that is a resource. |
23 | 23 |
|
| 24 | +If [`Worker`][]s are used, each thread has an independent `async_hooks` |
| 25 | +interface, and each thread will use a new set of async IDs. |
| 26 | + |
24 | 27 | ## Public API |
25 | 28 |
|
26 | 29 | ### Overview |
@@ -224,7 +227,7 @@ clearTimeout(setTimeout(() => {}, 10)); |
224 | 227 | ``` |
225 | 228 |
|
226 | 229 | Every new resource is assigned an ID that is unique within the scope of the |
227 | | -current process. |
| 230 | +current Node.js instance. |
228 | 231 |
|
229 | 232 | ###### `type` |
230 | 233 |
|
@@ -725,3 +728,4 @@ never be called. |
725 | 728 | [Hook Callbacks]: #async_hooks_hook_callbacks |
726 | 729 | [PromiseHooks]: https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk |
727 | 730 | [promise execution tracking]: #async_hooks_promise_execution_tracking |
| 731 | +[`Worker`]: worker.html#worker_worker |