11 lines
216 B
JavaScript
11 lines
216 B
JavaScript
|
setTimeout(() => {
|
||
|
let called = 0;
|
||
|
let result = '';
|
||
|
process.parentPort.on('message', (e) => {
|
||
|
result += e.data;
|
||
|
if (++called === 3) {
|
||
|
process.parentPort.postMessage(result);
|
||
|
}
|
||
|
});
|
||
|
}, 3000);
|