clusterhub
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -175,19 +175,10 @@ var cluster = require('cluster') | ||
worker.on('message', onmessage); | ||
worker.once('exit', function onexit() { | ||
workers.splice(workers.indexOf(obj), 1); | ||
worker.removeListener('online', obj.ononline); | ||
worker.removeListener('message', obj.onmessage); | ||
return false; | ||
}); | ||
return worker; | ||
}; | ||
/** | ||
* Remove workers on death | ||
*/ | ||
cluster.on('exit', function(worker) { | ||
workers.forEach(function(obj, i) { | ||
if (obj.worker === worker) { | ||
workers.splice(i, 1); | ||
worker.removeListener('online', obj.ononline); | ||
worker.removeListener('message', obj.onmessage); | ||
return false; | ||
} | ||
}); | ||
}); |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["cluster", "load balance", "database", "multi process", "sync"], | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -1,5 +0,4 @@ | ||
var hub = require('..') | ||
, cluster = require('cluster') | ||
, assert = require('assert') | ||
, WORKERS = 2 | ||
var hub = require('..'); | ||
var cluster = require('cluster'); | ||
var WORKERS = 2; | ||
@@ -28,3 +27,3 @@ | ||
cluster.on('exit', function(worker) { | ||
cluster.on('exit', function() { | ||
cluster.fork(); | ||
@@ -31,0 +30,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
var hub = require('..') | ||
, assert = require('assert') | ||
var hub = require('..'); | ||
var assert = require('assert'); | ||
@@ -4,0 +4,0 @@ |
@@ -1,5 +0,5 @@ | ||
var hub = require('..') | ||
, cluster = require('cluster') | ||
, assert = require('assert') | ||
, WORKERS = 1 | ||
var hub = require('..'); | ||
var cluster = require('cluster'); | ||
var assert = require('assert'); | ||
var WORKERS = 1; | ||
@@ -117,4 +117,4 @@ | ||
it('Does not fire any event', function(done) { | ||
var a = true | ||
, b = true | ||
var a = true; | ||
var b = true; | ||
@@ -147,3 +147,3 @@ hub.on('a', function() { | ||
hub.removeAllListeners('a') | ||
hub.removeAllListeners('a'); | ||
hub.once('remove', function() { | ||
@@ -156,3 +156,3 @@ assert(a); | ||
}); | ||
}) | ||
}); | ||
@@ -159,0 +159,0 @@ }); |
@@ -1,5 +0,4 @@ | ||
var hub = require('..') | ||
, cluster = require('cluster') | ||
, assert = require('assert') | ||
, WORKERS = 2 | ||
var hub = require('..'); | ||
var cluster = require('cluster'); | ||
var WORKERS = 2; | ||
@@ -6,0 +5,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
25280
763