MCPcopy Index your code
hub / github.com/nodejs/node / checkWorkerActive

Function checkWorkerActive

test/sequential/test-worker-eventlooputil.js:97–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97function checkWorkerActive() {
98 const w = workerELU();
99
100 metricsCh.port2.postMessage({ cmd: 'spin', dur: 50 });
101 metricsCh.port2.once('message', mustCall((wElu) => {
102 const w2 = workerELU(w);
103
104 assert.ok(w2.active >= 50, `${w2.active} < 50`);
105 assert.ok(wElu.active >= 50, `${wElu.active} < 50`);
106 assert.ok(idleActive(wElu) < idleActive(w2),
107 `${idleActive(wElu)} >= ${idleActive(w2)}`);
108
109 metricsCh.port2.postMessage({ cmd: 'close' });
110 }));
111}
112
113function idleActive(elu) {
114 return elu.idle + elu.active;

Callers 1

checkWorkerIdleFunction · 0.85

Calls 5

idleActiveFunction · 0.85
mustCallFunction · 0.50
postMessageMethod · 0.45
onceMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…