Skip to content

Commit 8120177

Browse files
committedMay 25, 2019
document async hooks
1 parent 8d9afb7 commit 8120177

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎docs/docs/api/promise.config.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Promise.config(Object {
1414
warnings: boolean=false,
1515
longStackTraces: boolean=false,
1616
cancellation: boolean=false,
17-
monitoring: boolean=false
17+
monitoring: boolean=false,
18+
asyncHooks: boolean=false
1819
} options) -> Object;
1920
```
2021

21-
Configure long stack traces, warnings, monitoring and cancellation. Note that even though `false` is the default here, a development environment might be detected which automatically enables long stack traces and warnings. For **webpack** and **browserify** *development* environment is *always* enabled. See [installation](/docs/install.html#browserify-and-webpack) on how to configure webpack and browserify for production.
22+
Configure long stack traces, warnings, monitoring, [async hooks](https://nodejs.org/api/async_hooks.html) and cancellation. Note that even though `false` is the default here, a development environment might be detected which automatically enables long stack traces and warnings. For **webpack** and **browserify** *development* environment is *always* enabled. See [installation](/docs/install.html#browserify-and-webpack) on how to configure webpack and browserify for production.
2223

2324
```js
2425
Promise.config({
@@ -29,7 +30,9 @@ Promise.config({
2930
// Enable cancellation
3031
cancellation: true,
3132
// Enable monitoring
32-
monitoring: true
33+
monitoring: true,
34+
// Enable async hooks
35+
asyncHooks: true,
3336
});
3437
```
3538

@@ -67,6 +70,10 @@ NODE_ENV=development BLUEBIRD_WARNINGS=0 node app.js
6770

6871
Cancellation is always configured separately per bluebird instance.
6972

73+
# Async hooks
74+
75+
Bluebird supports [async hooks](https://nodejs.org/api/async_hooks.html) in node versions 9.6.0 and later. After it is enabled promises from the bluebird instance track async hook context.
76+
7077
</markdown></div>
7178

7279
<div id="disqus_thread"></div>

0 commit comments

Comments
 (0)
Please sign in to comment.