GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: fix asyncLocalStorage.run() description · nodejs/node@ca6adcf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • async_context.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/async_context.md‎

Copy file name to clipboardExpand all lines: doc/api/async_context.md
+6-2Lines changed: 6 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ added:
223223
* `...args` {any}
224224

225225
Runs a function synchronously within a context and returns its
226-
return value. The store is not accessible outside of the callback function or
227-
the asynchronous operations created within the callback.
226+
return value. The store is not accessible outside of the callback function.
227+
The store is accessible to any asynchronous operations created within the
228+
callback.
228229

229230
The optional `args` are passed to the callback function.
230231

@@ -238,6 +239,9 @@ const store = { id: 2 };
238239
try {
239240
asyncLocalStorage.run(store, () => {
240241
asyncLocalStorage.getStore(); // Returns the store object
242+
setTimeout(() => {
243+
asyncLocalStorage.getStore(); // Returns the store object
244+
}, 200);
241245
throw new Error();
242246
});
243247
} catch (e) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.