electron/spec/fixtures/api/utility-process/post-message-queue.js

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);