Commit 45d2f4d
async_hooks: add AsyncResource.bind utility
Creates an internal AsyncResource and binds a function to it,
ensuring that the function is invoked within execution context
in which bind was called.
PR-URL: #34574
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>1 parent e7486d4 commit 45d2f4dCopy full SHA for 45d2f4d
File tree
Expand file treeCollapse file tree
3 files changed
+90
-5
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+90
-5
lines changedOpen diff view settings
Collapse file
+31-5Lines changed: 31 additions & 5 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
733 | 733 | |
734 | 734 | |
735 | 735 | |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | + |
| 740 | + |
| 741 | + |
| 742 | + |
| 743 | + |
| 744 | + |
| 745 | + |
| 746 | + |
| 747 | + |
| 748 | + |
| 749 | + |
| 750 | + |
| 751 | + |
| 752 | + |
| 753 | + |
| 754 | + |
| 755 | + |
| 756 | + |
| 757 | + |
| 758 | + |
| 759 | + |
| 760 | + |
| 761 | + |
736 | 762 | |
737 | 763 | |
738 | 764 | |
| ||
904 | 930 | |
905 | 931 | |
906 | 932 | |
907 | | - |
908 | | - |
909 | | - |
910 | | - |
911 | | - |
| 933 | + |
| 934 | + |
912 | 935 | |
| 936 | + |
| 937 | + |
| 938 | + |
913 | 939 | |
914 | 940 | |
915 | 941 | |
|
Collapse file
+24Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
| 5 | + |
5 | 6 | |
6 | 7 | |
7 | 8 | |
8 | 9 | |
9 | 10 | |
10 | 11 | |
11 | 12 | |
| 13 | + |
12 | 14 | |
13 | 15 | |
14 | 16 | |
| ||
208 | 210 | |
209 | 211 | |
210 | 212 | |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
211 | 235 | |
212 | 236 | |
213 | 237 | |
|
Collapse file
test/parallel/test-asyncresource-bind.js
Copy file name to clipboard+35Lines changed: 35 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 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
0 commit comments