src,async_hooks,n-api: refactor async callback handling
- Refactor how asynchronous code is executed from within Node
- Merge the two almost-but-not-quite identical
MakeCallback()
implementations - Provide a public
CallbackScope
class for embedders in order to enableMakeCallback()
-like behaviour without tying that to calling a JS function - Enable combining N-API async work with async-hooks
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
/cc @nodejs/async_hooks /cc @nodejs/n-api (Who may or may not only want to review the N-API commit; this is a breaking N-API change)