/third_party/node/test/async-hooks/ |
D | test-async-local-storage-enable-disable.js | 6 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 …]
|
D | test-async-local-storage-nested.js | 6 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);
|
D | test-async-local-storage-no-mix-contexts.js | 6 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');
|
D | test-async-local-storage-async-functions.js | 8 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);
|
D | test-async-local-storage-promises.js | 7 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);
|
D | test-async-local-storage-gcable.js | 11 let asyncLocalStorage = new AsyncLocalStorage(); variable 13 asyncLocalStorage.run({}, () => { 14 asyncLocalStorage.disable(); 16 onGC(asyncLocalStorage, { ongc: common.mustCall() }); 19 asyncLocalStorage = null;
|
D | test-async-local-storage-misc-stores.js | 6 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);
|
D | test-async-local-storage-enter-with.js | 6 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);
|
D | test-async-local-storage-async-await.js | 6 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);
|
D | test-async-local-storage-errors.js | 7 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);
|
D | test-async-local-storage-http.js | 7 const asyncLocalStorage = new AsyncLocalStorage(); constant 13 asyncLocalStorage.run(new Map(), () => { 14 const store = asyncLocalStorage.getStore(); 17 assert.strictEqual(asyncLocalStorage.getStore().get('hello'), 'world');
|
D | test-async-local-storage-args.js | 6 const asyncLocalStorage = new AsyncLocalStorage(); constant 8 asyncLocalStorage.run({}, (runArg) => { 10 asyncLocalStorage.exit((exitArg) => {
|
D | test-async-local-storage-http-agent.js | 7 const asyncLocalStorage = new AsyncLocalStorage(); constant 24 asyncLocalStorage.run(i, () => { 26 assert.strictEqual(asyncLocalStorage.getStore(), i);
|
/third_party/node/test/parallel/ |
D | test-timers-clearImmediate-als.js | 7 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/ |
D | async-resource-vs-destroy.js | 102 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/ |
D | async_hooks.md | 977 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/ |
D | CHANGELOG_V14.md | 1677 …](https://github.com/nodejs/node/commit/ac59022106)] - **doc**: fix asyncLocalStorage.run() descri…
|