Skip to content

Instantly share code, notes, and snippets.

View brighthas's full-sized avatar

迁移到 leogiese brighthas

View GitHub Profile
var cluster = require('cluster');
var PORT = +process.env.PORT || 1337;
if (cluster.isMaster) {
// In real life, you'd probably use more than just 2 workers,
// and perhaps not put the master and worker in the same file.
cluster.fork();
cluster.fork();
cluster.on('disconnect', function(worker) {