File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -206,9 +206,9 @@ function printContext() {
206
206
}
207
207
` ` `
208
208
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.
212
212
213
213
The motivation for the ` valueChangedListener` is that we can have a cleaner way
214
214
to monitor the value changes of an AsyncLocal without any ` setValue` wrappers.
Original file line number Diff line number Diff line change @@ -155,13 +155,9 @@ setTimeout(() => {
155
155
}, 1000 );
156
156
```
157
157
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 ` .
165
161
166
162
### Stop propagation
167
163
You can’t perform that action at this time.
0 commit comments