Skip to content

doc: improve AsyncLocalStorage sample

Improves sample snippet in AsyncLocalStorage doc section. Recently I've heard the following complains from one of early adopters of the API:

  • Current snippet can't be run as is (because of the non-existing someAsyncOperation function)
  • Current snippet logs only in on-error case and, in general, could be improved to show a solution for a real-world problem

The update tries to address the above items.

cc @vdeturckheim

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