Commit 4d5981b
async_hooks: add sync enterWith to ALS
This allows transitioning the entire following sync and async execution
sub-tree to the given async storage context. With this one can be sure
the context binding will remain for any following sync activity and all
descending async execution whereas the `run*(...)` methods must wrap
everything that is intended to exist within the context. This is helpful
for scenarios such as prepending a `'connection'` event to an http
server which binds everything that occurs within each request to
the given context. This is helpful for APMs to minimize the need
for patching and especially adding closures.
PR-URL: #31945
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>1 parent 02ebc81 commit 4d5981bCopy full SHA for 4d5981b
File tree
Expand file treeCollapse file tree
3 files changed
+65
-3
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/async-hooks
Expand file treeCollapse file tree
3 files changed
+65
-3
lines changedOpen diff view settings
Collapse file
+42Lines changed: 42 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
950 | 950 | |
951 | 951 | |
952 | 952 | |
| 953 | + |
| 954 | + |
| 955 | + |
| 956 | + |
| 957 | + |
| 958 | + |
| 959 | + |
| 960 | + |
| 961 | + |
| 962 | + |
| 963 | + |
| 964 | + |
| 965 | + |
| 966 | + |
| 967 | + |
| 968 | + |
| 969 | + |
| 970 | + |
| 971 | + |
| 972 | + |
| 973 | + |
| 974 | + |
| 975 | + |
| 976 | + |
| 977 | + |
| 978 | + |
| 979 | + |
| 980 | + |
| 981 | + |
| 982 | + |
| 983 | + |
| 984 | + |
| 985 | + |
| 986 | + |
| 987 | + |
| 988 | + |
| 989 | + |
| 990 | + |
| 991 | + |
| 992 | + |
| 993 | + |
| 994 | + |
953 | 995 | |
954 | 996 | |
955 | 997 | |
|
Collapse file
+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | | - |
| 248 | + |
249 | 249 | |
250 | 250 | |
251 | 251 | |
| ||
258 | 258 | |
259 | 259 | |
260 | 260 | |
261 | | - |
| 261 | + |
262 | 262 | |
263 | 263 | |
264 | 264 | |
| ||
288 | 288 | |
289 | 289 | |
290 | 290 | |
291 | | - |
| 291 | + |
292 | 292 | |
293 | 293 | |
294 | 294 | |
|
Collapse file
test/async-hooks/test-async-local-storage-enter-with.js
Copy file name to clipboard+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
0 commit comments