• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3const assert = require('assert');
4const cluster = require('cluster');
5
6if (cluster.isMaster) {
7  const worker = cluster.fork();
8
9  worker.on('exit', common.mustCall((code, signal) => {
10    assert.strictEqual(code, 0);
11    assert.strictEqual(signal, null);
12  }));
13
14  worker.on('online', () => {
15    worker.send({
16      cmd: 'NODE_CLUSTER',
17      ack: -1
18    }, () => {
19      worker.disconnect();
20    });
21  });
22}
23