Skip to content

Instantly share code, notes, and snippets.

View kristjanmik's full-sized avatar

Kristján Ingi Mikaelsson kristjanmik

View GitHub Profile
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.