mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/5517 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>process-exit-stdio-flushing
Rich Trott
9 years ago
committed by
James M Snell
16 changed files with 60 additions and 26 deletions
@ -1,10 +1,11 @@ |
|||||
'use strict'; |
'use strict'; |
||||
var cluster = require('cluster'); |
const cluster = require('cluster'); |
||||
var os = require('os'); |
const os = require('os'); |
||||
|
const path = require('path'); |
||||
|
|
||||
if (cluster.isMaster) { |
if (cluster.isMaster) { |
||||
console.log('master running on pid %d', process.pid); |
console.log('master running on pid %d', process.pid); |
||||
for (var i = 0, n = os.cpus().length; i < n; ++i) cluster.fork(); |
for (var i = 0, n = os.cpus().length; i < n; ++i) cluster.fork(); |
||||
} else { |
} else { |
||||
require(__dirname + '/http_simple.js'); |
require(path.join(__dirname, 'http_simple.js')); |
||||
} |
} |
||||
|
Loading…
Reference in new issue