GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/test/parallel/test-async-wrap-destroyid.js at main · synapse/node Expand file tree/ Copy pathtest-async-wrap-destroyid.jsMore file actions 39 lines (32 loc) · 910 Bytes / Copy pathtest-async-wrap-destroyid.jsFile metadata and controls39 lines (32 loc) · 910 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 // Flags: --expose-internals 'use strict'; const common = require('../common'); const { internalBinding } = require('internal/test/binding'); const async_wrap = internalBinding('async_wrap'); const assert = require('assert'); const async_hooks = require('async_hooks'); const RUNS = 5; let test_id = null; let run_cntr = 0; let hooks = null; process.on('beforeExit', common.mustCall(() => { process.removeAllListeners('uncaughtException'); hooks.disable(); assert.strictEqual(test_id, null); assert.strictEqual(run_cntr, RUNS); })); hooks = async_hooks.createHook({ destroy(id) { if (id === test_id) { run_cntr++; test_id = null; } }, }).enable(); (function runner(n) { assert.strictEqual(test_id, null); if (n <= 0) return; test_id = (Math.random() * 1e9) >>> 0; async_wrap.queueDestroyAsyncId(test_id); setImmediate(common.mustCall(runner), n - 1); })(RUNS); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |