electron/spec/fixtures/module/fork_ping.js
2018-09-29 09:17:00 +10:00

16 lines
370 B
JavaScript

const path = require('path')
process.on('uncaughtException', function (error) {
process.send(error.stack)
})
const child = require('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)
})