bigcluster
v1.1.1
Published
Smart cluster framwork NodeJS
Downloads
2
Readme
bigcluster
Node.js Smart cluster framwork NodeJS
Installation
$ npm install bigcluster
Usage
var bigcluster = require('bigcluster');
bigcluster(0, function(workid) {
console.log("work id: ", workid);
}, function(workcount) {
console.log("work count: ", workcount);
});
Parameters
|Name|Type|Description|Requirement| |---|---|---|---| |count|int|required work count|Y| |onWorker|function|the worker processor|Y| |onMaster|function|the master processor|N|
About count:
|Value|Description| |---|---|
|-1 or <0|workcount = 1, disable cluster mode.|
|0|workcount = cpu count, auto restart exited worker.|
|>0|workcount = count, auto restart exited worker.|