Skip to content

Commit ca0ace8

Browse files
committed
Update SOLUTION.md
1 parent de8f7a4 commit ca0ace8

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ function printContext() {
206206
}
207207
```
208208
209-
The `valueChangedListener` will be called each time the value in the current
210-
async flow has been updated by explicit `AsyncLocal.setValue` call. It can be
211-
treated as a property setter of an object.
209+
The optional `valueChangedListener` will be called each time the value in the
210+
current async flow has been updated by explicit `AsyncLocal.setValue` call. It
211+
can be treated as a property setter of an object.
212212
213213
The motivation for the `valueChangedListener` is that we can have a cleaner way
214214
to monitor the value changes of an AsyncLocal without any `setValue` wrappers.

SOLUTION.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,9 @@ setTimeout(() => {
155155
}, 1000);
156156
```
157157

158-
The propagation operation in the section doesn't mean an actual propagation
159-
operation will be effective immediately. It is possible to link those async
160-
operation by the time of invocation like `Promise.resolve(value)`. As such,
161-
one of the major design goal of current `AsyncLocal` value propagation can be
162-
fulfilled by leveraging the performance hit to the time when we explicitly call
163-
`AsyncLocal.getValue()`. The applications that didn't use any AsyncLocal
164-
features will not be punished for the implementation of AsyncLocal.
158+
In the example above, an object was stored in the AsyncLocal. Therefore, it is
159+
possible to write properties on the object but not setting the value of the
160+
AsyncLocal and not triggering `valueChangedListener`.
165161

166162
### Stop propagation
167163

0 commit comments

Comments
 (0)