| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 512ae7e commit 4785755
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,6 +129,10 @@ class MyAddedCallbacks extends MyAsyncCallbacks { | |||
| 129 | 129 | const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); | |
| 130 | 130 | ``` | |
| 131 | 131 | ||
| 132 | + Because promises are asynchronous resources whose lifecycle is tracked | ||
| 133 | + via the async hooks mechanism, the `init()`, `before()`, `after()`, and | ||
| 134 | + `destroy()` callbacks *must not* be async functions that return promises. | ||
| 135 | + | ||
| 132 | 136 | ##### Error handling | |
| 133 | 137 | ||
| 134 | 138 | If any `AsyncHook` callbacks throw, the application will print the stack trace | |
| Back | FazBrowse Home | New Git URL |
0 commit comments