Skip to content

Commit d1e6276

Browse files
TrottStephen Belanger
authored andcommitted
fixup! test: test tracing channel run stores behaviour
1 parent ebd1042 commit d1e6276

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

doc/api/diagnostics_channel.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ added:
471471
* `store` {AsyncLocalStorage} The store to which to bind the context data
472472
* `transform` {Function} Transform context data before setting the store context
473473

474-
When [`channel.runStores(context, ...)`][] is called, the given context data will
475-
be applied to any store bound to the channel. If the store has already been
474+
When [`channel.runStores(context, ...)`][] is called, the given context data
475+
will be applied to any store bound to the channel. If the store has already been
476476
bound the previous `transform` function will be replaced with the new one.
477477
The `transform` function may be omitted to set the given context data as the
478478
context directly.
@@ -910,7 +910,7 @@ enables context loss recovery in some cases.
910910

911911
```mjs
912912
import diagnostics_channel from 'node:diagnostics_channel';
913-
import { AsyncLocalStorage } from 'async_hooks';
913+
import { AsyncLocalStorage } from 'node:async_hooks';
914914

915915
const channels = diagnostics_channel.tracingChannel('my-channel');
916916
const myStore = new AsyncLocalStorage();
@@ -931,7 +931,7 @@ channels.asyncStart.bindStore(myStore, (data) => {
931931

932932
```cjs
933933
const diagnostics_channel = require('node:diagnostics_channel');
934-
const { AsyncLocalStorage } = require('async_hooks');
934+
const { AsyncLocalStorage } = require('node:async_hooks');
935935

936936
const channels = diagnostics_channel.tracingChannel('my-channel');
937937
const myStore = new AsyncLocalStorage();
@@ -1132,14 +1132,13 @@ added: v16.18.0
11321132
Emitted when a new thread is created.
11331133

11341134
[TracingChannel Channels]: #tracingchannel-channels
1135-
[context loss]: async_context.md#troubleshooting-context-loss
11361135
[`'uncaughtException'`]: process.md#event-uncaughtexception
11371136
[`TracingChannel`]: #class-tracingchannel
11381137
[`Worker`]: worker_threads.md#class-worker
11391138
[`asyncEnd` event]: #asyncendevent
11401139
[`asyncStart` event]: #asyncstartevent
11411140
[`channel.bindStore(store)`]: #channelbindstorestore-transform
1142-
[`channel.runStores(data, ...)`]: #channelrunstoresdata-fn-thisarg-args
1141+
[`channel.runStores(context, ...)`]: #channelrunstorescontext-fn-thisarg-args
11431142
[`channel.subscribe(onMessage)`]: #channelsubscribeonmessage
11441143
[`channel.unsubscribe(onMessage)`]: #channelunsubscribeonmessage
11451144
[`diagnostics_channel.channel(name)`]: #diagnostics_channelchannelname
@@ -1149,3 +1148,4 @@ Emitted when a new thread is created.
11491148
[`end` event]: #endevent
11501149
[`error` event]: #errorevent
11511150
[`start` event]: #startevent
1151+
[context loss]: async_context.md#troubleshooting-context-loss

0 commit comments

Comments
 (0)