electron/spec/fixtures/module/fork_ping.js
Milan Burda d78f37ec8f
refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04:00

16 lines
390 B
JavaScript

const path = require('node:path');
process.on('uncaughtException', function (error) {
process.send(error.stack);
});
const child = require('node:child_process').fork(path.join(__dirname, '/ping.js'));
process.on('message', function (msg) {
child.send(msg);
});
child.on('message', function (msg) {
process.send(msg);
});
child.on('exit', function (code) {
process.exit(code);
});