0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/fixtures/cluster-preload-test.js
Ali Ijaz Sheikh b6e22c4bd5 src: setup cluster workers before preloading
We need to process cluster workers before any preload modules is
executed. Otherwise, the child processes are not correctly disovered
as clustered workers inside the preloaded modules.

Fixes: https://github.com/iojs/io.js/issues/1269
PR-URL: https://github.com/iojs/io.js/pull/1314
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-04-04 00:53:45 +02:00

8 lines
207 B
JavaScript

var cluster = require('cluster');
if (cluster.isMaster) {
cluster.fork(); // one child
cluster.on('exit', function(worker, code, signal) {
console.log('worker terminated with code ' + code);
});
}