Commit f71fc90
async_hooks: add store arg in AsyncLocalStorage
This commit introduces store as the first argument in
AsyncLocalStorage's run methods. The change is motivated by the
following expectation: most users are going to use a custom object
as the store and an extra Map created by the previous implementation
is an overhead for their use case.
Important note. This is a backwards incompatible change.
It was discussed and agreed an incompatible change is ok
since the API is still experimental and the modified
methods were only added within the last week so usage
will be minimal to none.
PR-URL: #31930
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>1 parent 3497370 commit f71fc90Copy full SHA for f71fc90
File tree
Expand file treeCollapse file tree
14 files changed
+73
-47
lines changedOpen diff view settings
Filter options
- benchmark/async_hooks
- doc/api
- lib
- test/async-hooks
Expand file treeCollapse file tree
14 files changed
+73
-47
lines changedOpen diff view settings
Collapse file
benchmark/async_hooks/async-resource-vs-destroy.js
Copy file name to clipboardExpand all lines: benchmark/async_hooks/async-resource-vs-destroy.js+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
106 | 106 | |
107 | 107 | |
108 | 108 | |
109 | | - |
| 109 | + |
110 | 110 | |
111 | 111 | |
112 | 112 | |
| ||
118 | 118 | |
119 | 119 | |
120 | 120 | |
121 | | - |
| 121 | + |
122 | 122 | |
123 | 123 | |
124 | 124 | |
125 | 125 | |
126 | | - |
| 126 | + |
127 | 127 | |
128 | 128 | |
129 | 129 | |
|
Collapse file
+25-21Lines changed: 25 additions & 21 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
893 | 893 | |
894 | 894 | |
895 | 895 | |
896 | | - |
| 896 | + |
897 | 897 | |
898 | 898 | |
899 | 899 | |
| ||
943 | 943 | |
944 | 944 | |
945 | 945 | |
946 | | - |
| 946 | + |
947 | 947 | |
948 | 948 | |
949 | 949 | |
950 | 950 | |
951 | 951 | |
952 | 952 | |
953 | | - |
| 953 | + |
954 | 954 | |
955 | 955 | |
956 | 956 | |
957 | 957 | |
| 958 | + |
958 | 959 | |
959 | 960 | |
960 | 961 | |
961 | 962 | |
962 | | - |
963 | | - |
964 | | - |
965 | | - |
966 | | - |
| 963 | + |
| 964 | + |
| 965 | + |
| 966 | + |
967 | 967 | |
968 | 968 | |
969 | 969 | |
| ||
975 | 975 | |
976 | 976 | |
977 | 977 | |
978 | | - |
979 | | - |
| 978 | + |
| 979 | + |
| 980 | + |
980 | 981 | |
981 | | - |
| 982 | + |
982 | 983 | |
983 | 984 | |
984 | 985 | |
| ||
1007 | 1008 | |
1008 | 1009 | |
1009 | 1010 | |
1010 | | - |
1011 | | - |
| 1011 | + |
| 1012 | + |
1012 | 1013 | |
1013 | 1014 | |
1014 | 1015 | |
1015 | | - |
| 1016 | + |
1016 | 1017 | |
1017 | 1018 | |
1018 | 1019 | |
1019 | | - |
| 1020 | + |
1020 | 1021 | |
1021 | 1022 | |
1022 | 1023 | |
1023 | 1024 | |
| 1025 | + |
1024 | 1026 | |
1025 | 1027 | |
1026 | 1028 | |
| ||
1038 | 1040 | |
1039 | 1041 | |
1040 | 1042 | |
| 1043 | + |
1041 | 1044 | |
1042 | | - |
1043 | | - |
| 1045 | + |
| 1046 | + |
1044 | 1047 | |
1045 | 1048 | |
1046 | 1049 | |
| ||
1073 | 1076 | |
1074 | 1077 | |
1075 | 1078 | |
1076 | | - |
| 1079 | + |
1077 | 1080 | |
1078 | 1081 | |
1079 | 1082 | |
1080 | 1083 | |
1081 | 1084 | |
1082 | | - |
| 1085 | + |
1083 | 1086 | |
1084 | 1087 | |
1085 | 1088 | |
| ||
1105 | 1108 | |
1106 | 1109 | |
1107 | 1110 | |
| 1111 | + |
1108 | 1112 | |
1109 | | - |
| 1113 | + |
1110 | 1114 | |
1111 | 1115 | |
1112 | 1116 | |
| ||
1135 | 1139 | |
1136 | 1140 | |
1137 | 1141 | |
1138 | | - |
| 1142 | + |
1139 | 1143 | |
1140 | 1144 | |
1141 | 1145 | |
|
Collapse file
+6-8Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
5 | 4 | |
6 | 5 | |
7 | 6 | |
8 | | - |
9 | 7 | |
10 | 8 | |
11 | 9 | |
| ||
247 | 245 | |
248 | 246 | |
249 | 247 | |
250 | | - |
| 248 | + |
251 | 249 | |
252 | 250 | |
253 | 251 | |
254 | 252 | |
255 | 253 | |
256 | 254 | |
257 | | - |
| 255 | + |
258 | 256 | |
259 | 257 | |
260 | 258 | |
| ||
264 | 262 | |
265 | 263 | |
266 | 264 | |
267 | | - |
268 | | - |
| 265 | + |
| 266 | + |
269 | 267 | |
270 | 268 | |
271 | 269 | |
| ||
289 | 287 | |
290 | 288 | |
291 | 289 | |
292 | | - |
293 | | - |
| 290 | + |
| 291 | + |
294 | 292 | |
295 | 293 | |
296 | 294 | |
|
Collapse file
test/async-hooks/test-async-local-storage-args.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-args.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
| 8 | + |
9 | 9 | |
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
16 | 16 | |
17 | 17 | |
18 | 18 | |
|
Collapse file
test/async-hooks/test-async-local-storage-async-await.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-async-await.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
16 | 16 | |
17 | 17 | |
18 | 18 | |
|
Collapse file
test/async-hooks/test-async-local-storage-async-functions.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-async-functions.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | | - |
| 22 | + |
23 | 23 | |
24 | 24 | |
25 | 25 | |
|
Collapse file
test/async-hooks/test-async-local-storage-enable-disable.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-enable-disable.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
| 8 | + |
9 | 9 | |
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | 15 | |
16 | | - |
| 16 | + |
17 | 17 | |
18 | 18 | |
19 | 19 | |
|
Collapse file
test/async-hooks/test-async-local-storage-errors-async.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-errors-async.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
16 | | - |
| 16 | + |
17 | 17 | |
18 | 18 | |
19 | 19 | |
|
Collapse file
test/async-hooks/test-async-local-storage-errors-sync-ret.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-errors-sync-ret.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
| 17 | + |
18 | 18 | |
19 | 19 | |
20 | 20 | |
|
Collapse file
test/async-hooks/test-async-local-storage-http.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-async-local-storage-http.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | | - |
| 13 | + |
14 | 14 | |
15 | 15 | |
16 | 16 | |
|
0 commit comments