Skip to content
Prev Previous commit
Next Next commit
lint fix
  • Loading branch information
vdeturckheim authored and mhdawson committed May 25, 2021
commit 6224e885f5a48c1205a8e8cbb11f680152c1c7ac
10 changes: 6 additions & 4 deletions doc/api/async_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<!-- source_link=lib/async_hooks.js -->

## Introduction
These classes are used to associate state and propagate it throughout callbacks and promise
chains. They allow storing data throughout the lifetime of a web request
These classes are used to associate state and propagate it throughout
callbacks and promise chains.
They allow storing data throughout the lifetime of a web request
or any other asynchronous duration. It is similar to thread-local storage
in other languages.

Expand Down Expand Up @@ -71,8 +72,9 @@ http.get('http://localhost:8080');
// 1: finish
```

When having multiple instances of `AsyncLocalStorage`, they are independent
from each other. It is safe to instantiate this class multiple times.
Each instance of `AsyncLocalStorage` maintains an independent storage context.
Multiple instances can safely exist simultaneously without risk of interfering
with each other data.

### `new AsyncLocalStorage()`
<!-- YAML
Expand Down