Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-50-spawn / test-cpfork-a-child.js
364 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | var assert = require('assert'); |
6 | var cluster = require('cluster'); |
7 | |
8 | assert(process.send); |
9 | assert(!cluster.worker); |
10 | |
11 | console.log('Hello from cpfork-a-child!'); |
12 | console.log('Args', JSON.stringify(process.argv.slice(2))); |
13 | |
14 | process.on('message', function (value) { |
15 | if (value === 128) process.exit(); |
16 | process.send(value * 2); |
17 | }); |
18 |
Built with git-ssb-web