Skip to content

Commit 4d4ef2f

Browse files
Flarnakiyomizumia
authored andcommitted
doc: correct async_hooks sample outputs
Correct the output of async_hooks samples * `TIMERWRAP` has been removed in nodejs#20894 * `console.log()` doesn't issue `TTYWRAP` nor `SIGNALWRAP` I don't know which PR caused that `console.log()` is no longer using `TTYWRAP` and `SIGNALWRAP`; I think it was between 8.4.0 and 8.5.0. PR-URL: nodejs#24050 Refs: nodejs#20894 Reviewed-By: James M Snell <[email protected]>
1 parent 56013ce commit 4d4ef2f

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

doc/api/async_hooks.md

+15-24
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ require('net').createServer((conn) => {}).listen(8080);
276276
Output when hitting the server with `nc localhost 8080`:
277277

278278
```console
279-
TCPSERVERWRAP(2): trigger: 1 execution: 1
280-
TCPWRAP(4): trigger: 2 execution: 0
279+
TCPSERVERWRAP(5): trigger: 1 execution: 1
280+
TCPWRAP(7): trigger: 5 execution: 0
281281
```
282282

283283
The `TCPSERVERWRAP` is the server which receives the connections.
@@ -354,27 +354,18 @@ require('net').createServer(() => {}).listen(8080, () => {
354354
Output from only starting the server:
355355

356356
```console
357-
TCPSERVERWRAP(2): trigger: 1 execution: 1
358-
TickObject(3): trigger: 2 execution: 1
359-
before: 3
360-
Timeout(4): trigger: 3 execution: 3
361-
TIMERWRAP(5): trigger: 3 execution: 3
362-
after: 3
363-
destroy: 3
364-
before: 5
365-
before: 4
366-
TTYWRAP(6): trigger: 4 execution: 4
367-
SIGNALWRAP(7): trigger: 4 execution: 4
368-
TTYWRAP(8): trigger: 4 execution: 4
369-
>>> 4
370-
TickObject(9): trigger: 4 execution: 4
371-
after: 4
372-
after: 5
373-
before: 9
374-
after: 9
375-
destroy: 4
376-
destroy: 9
377-
destroy: 5
357+
TCPSERVERWRAP(5): trigger: 1 execution: 1
358+
TickObject(6): trigger: 5 execution: 1
359+
before: 6
360+
Timeout(7): trigger: 6 execution: 6
361+
after: 6
362+
destroy: 6
363+
before: 7
364+
>>> 7
365+
TickObject(8): trigger: 7 execution: 7
366+
after: 7
367+
before: 8
368+
after: 8
378369
```
379370

380371
As illustrated in the example, `executionAsyncId()` and `execution` each specify
@@ -384,7 +375,7 @@ the value of the current execution context; which is delineated by calls to
384375
Only using `execution` to graph resource allocation results in the following:
385376

386377
```console
387-
TTYWRAP(6) -> Timeout(4) -> TIMERWRAP(5) -> TickObject(3) -> root(1)
378+
Timeout(7) -> TickObject(6) -> root(1)
388379
```
389380

390381
The `TCPSERVERWRAP` is not part of this graph, even though it was the reason for

0 commit comments

Comments
 (0)