MCPcopy
hub / github.com/OptimalBits/bull / initChild

Function initChild

lib/process/child-pool.js:113–130  ·  view source on GitHub ↗
(child, processFile)

Source from the content-addressed store, hash-verified

111};
112
113async function initChild(child, processFile) {
114 const onComplete = new Promise((resolve, reject) => {
115 const onMessageHandler = msg => {
116 if (msg.cmd === 'init-complete') {
117 resolve();
118 } else if (msg.cmd === 'error') {
119 reject(msg.error);
120 }
121 child.off('message', onMessageHandler);
122 };
123 child.on('message', onMessageHandler);
124 });
125
126 await new Promise(resolve =>
127 child.send({ cmd: 'init', value: processFile }, resolve)
128 );
129 await onComplete;
130}
131function ChildPoolSingleton(isSharedChildPool = false) {
132 if (isSharedChildPool === false) {
133 return new ChildPool();

Callers 1

child-pool.jsFile · 0.85

Calls 1

onMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…