1.2.5 • Published 7 years ago

cluster-wrap v1.2.5

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

cluster-wrap

light wrap around nodejs cluster
fork of throng https://github.com/hunterloftis/throng
grabbed emitter handling/proxying
removed lodash dependency
removed lifetime functionality

example usage:

const clusterWrap = require('cluster-wrap');

function worker(workerId) {
  console.log({ action: 'worker', workerId: workerId });
  // do some worker stuff    
}

function master() {
  console.log({ action: 'master' });
  // do some master stuff    
}

const concurrency = require('os').cpus().length;
clusterWrap({
  worker  : worker,      // required worker function
  workers : concurrency, // optional, default ncpus
  master  : master       // optional, default () => {}
})
1.2.5

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago