Skip to content

async_hooks: add sync enterWith to async storage

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 handler 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.

Depends on #31930

cc @vdeturckheim @puzpuzpuz @Flarna

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading