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

Function runChildWorkerThread

test/parallel/test-inspector-workers-flat-list.js:55–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53}
54
55function runChildWorkerThread() {
56 let worker = null;
57 parentPort.on('message', ({ child, depth, done }) => {
58 if (done) {
59 if (worker) {
60 worker.postMessage({ done: true });
61 }
62 parentPort.close();
63 } else if (depth) {
64 parentPort.postMessage({ child: depth });
65 if (depth < MAX_DEPTH) {
66 worker = startWorker(depth + 1, workerCallback);
67 }
68 } else if (child) {
69 parentPort.postMessage({ child });
70 }
71 });
72}
73
74if (isMainThread) {
75 runMainThread();

Calls 4

startWorkerFunction · 0.70
closeMethod · 0.65
onMethod · 0.45
postMessageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…