Home
last modified time | relevance | path

Searched refs:asyncLocalStorage (Results 1 – 17 of 17) sorted by relevance

/third_party/node/test/async-hooks/
Dtest-async-local-storage-enable-disable.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
8 asyncLocalStorage.run(new Map(), () => {
9 asyncLocalStorage.getStore().set('foo', 'bar');
11 assert.strictEqual(asyncLocalStorage.getStore().get('foo'), 'bar');
13 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
16 asyncLocalStorage.disable();
17 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
20 asyncLocalStorage.exit(() => {
21 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
23 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
[all …]
Dtest-async-local-storage-nested.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
11 assert.strictEqual(asyncLocalStorage.getStore(), outer);
13 asyncLocalStorage.run(inner, () => {
14 assert.strictEqual(asyncLocalStorage.getStore(), inner);
16 assert.strictEqual(asyncLocalStorage.getStore(), outer);
18 asyncLocalStorage.exit(() => {
19 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
21 assert.strictEqual(asyncLocalStorage.getStore(), outer);
24 asyncLocalStorage.run(outer, testInner);
25 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-no-mix-contexts.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
10 asyncLocalStorage.run(new Map(), () => {
12 const store = asyncLocalStorage.getStore();
17 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'world');
19 asyncLocalStorage.exit(() => {
20 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
23 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'world');
31 asyncLocalStorage.run(new Map(), () => {
32 const store = asyncLocalStorage.getStore();
35 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'earth');
Dtest-async-local-storage-async-functions.js8 const asyncLocalStorage = new AsyncLocalStorage(); constant
12 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
17 assert.notStrictEqual(asyncLocalStorage.getStore(), undefined);
18 assert.strictEqual(asyncLocalStorage.getStore().get('key'), 'value');
19 await asyncLocalStorage.exit(testOut);
22 asyncLocalStorage.run(new Map(), () => {
23 const store = asyncLocalStorage.getStore();
27 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-promises.js7 const asyncLocalStorage = new AsyncLocalStorage();
11 assert.strictEqual(asyncLocalStorage.getStore().get('a'), 1);
15 asyncLocalStorage.run(new Map(), () => {
16 const store = asyncLocalStorage.getStore();
22 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
25 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-gcable.js11 let asyncLocalStorage = new AsyncLocalStorage(); variable
13 asyncLocalStorage.run({}, () => {
14 asyncLocalStorage.disable();
16 onGC(asyncLocalStorage, { ongc: common.mustCall() });
19 asyncLocalStorage = null;
Dtest-async-local-storage-misc-stores.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
8 asyncLocalStorage.run('hello node', () => {
9 assert.strictEqual(asyncLocalStorage.getStore(), 'hello node');
13 asyncLocalStorage.run(runStore, () => {
14 assert.strictEqual(asyncLocalStorage.getStore(), runStore);
Dtest-async-local-storage-enter-with.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
10 asyncLocalStorage.enterWith(store);
12 assert.strictEqual(asyncLocalStorage.getStore(), store);
14 assert.strictEqual(asyncLocalStorage.getStore(), store);
19 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-async-await.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
9 asyncLocalStorage.getStore().set('foo', 'bar');
11 assert.strictEqual(asyncLocalStorage.getStore().get('foo'), 'bar');
15 await asyncLocalStorage.run(new Map(), test);
16 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-errors.js7 const asyncLocalStorage = new AsyncLocalStorage(); constant
13 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'node');
17 asyncLocalStorage.run(new Map(), () => {
18 const store = asyncLocalStorage.getStore();
30 assert.strictEqual(asyncLocalStorage.getStore(), undefined);
Dtest-async-local-storage-http.js7 const asyncLocalStorage = new AsyncLocalStorage(); constant
13 asyncLocalStorage.run(new Map(), () => {
14 const store = asyncLocalStorage.getStore();
17 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'world');
Dtest-async-local-storage-args.js6 const asyncLocalStorage = new AsyncLocalStorage(); constant
8 asyncLocalStorage.run({}, (runArg) => {
10 asyncLocalStorage.exit((exitArg) => {
Dtest-async-local-storage-http-agent.js7 const asyncLocalStorage = new AsyncLocalStorage(); constant
24 asyncLocalStorage.run(i, () => {
26 assert.strictEqual(asyncLocalStorage.getStore(), i);
/third_party/node/test/parallel/
Dtest-timers-clearImmediate-als.js7 const asyncLocalStorage = new AsyncLocalStorage(); constant
12 asyncLocalStorage.run(new Map(), common.mustCall(() => {
14 const store = asyncLocalStorage.getStore();
20 const store = asyncLocalStorage.getStore();
/third_party/node/benchmark/async_hooks/
Dasync-resource-vs-destroy.js102 const asyncLocalStorage = new AsyncLocalStorage();
104 asyncLocalStorage.run({}, () => {
115 const store = asyncLocalStorage.getStore();
123 const store = asyncLocalStorage.getStore();
131 asyncLocalStorage.disable();
/third_party/node/doc/api/
Dasync_hooks.md977 const asyncLocalStorage = new AsyncLocalStorage();
980 const id = asyncLocalStorage.getStore();
986 asyncLocalStorage.run(idSeq++, () => {
1016 ### `asyncLocalStorage.disable()`
1022 to `asyncLocalStorage.getStore()` will return `undefined` until
1023 `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
1025 When calling `asyncLocalStorage.disable()`, all current contexts linked to the
1028 Calling `asyncLocalStorage.disable()` is required before the
1029 `asyncLocalStorage` can be garbage collected. This does not apply to stores
1030 provided by the `asyncLocalStorage`, as those objects are garbage collected
[all …]
/third_party/node/doc/changelogs/
DCHANGELOG_V14.md1677 …](https://github.com/nodejs/node/commit/ac59022106)] - **doc**: fix asyncLocalStorage.run() descri…