Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[squash] addressing nits pointed out by Trevor
  • Loading branch information
thlorenz authored and AndreasMadsen committed May 29, 2017
commit 1e35d734295e8dbf07fb22c995970bcf424cd27d
16 changes: 10 additions & 6 deletions doc/api/async_hooks.md
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.

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".
Expand Down Expand Up @@ -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
Expand Down