Comparing version 0.4.6 to 0.4.7
@@ -44,2 +44,3 @@ var _ = require('underscore'), | ||
var components = this.components = {}, | ||
workers = this.workers = {}, | ||
reducers = this.reducers = {}; | ||
@@ -52,7 +53,17 @@ | ||
components[component.name] = { | ||
reducer: component.reducer, | ||
count: components[component.name] ? components[component.name].count + 1 : 1 | ||
'reducer': component.reducer, | ||
'count': components[component.name] ? components[component.name].count + 1 : 1 | ||
}; | ||
workers[component.worker] = workers[component.worker] || []; | ||
workers[component.worker].push(component.name); | ||
}); | ||
emitter.on('worker-died', function(worker){ | ||
_.each(workers[worker] || [], function(component){ | ||
components[component].count = components[component].count - 1; | ||
}); | ||
}); | ||
this.reducer('default', DEFAULT_REDUCER) | ||
@@ -71,4 +82,5 @@ .reducer('sum', DEFAULT_REDUCER) | ||
emitter.emit('new-component-status', { | ||
name : name, | ||
reducer: reducer | ||
'name' : name, | ||
'reducer': reducer, | ||
'worker': process.pid | ||
}); | ||
@@ -287,2 +299,7 @@ | ||
}); | ||
process.cluster.emitter.on('died', function(pid){ | ||
//bugfix of slow vi, as some worker died, and we didn't reduce the expectations. | ||
process.emit.apply(process, ['worker-died', pid]); | ||
}); | ||
} | ||
@@ -289,0 +306,0 @@ |
@@ -8,3 +8,3 @@ { | ||
"name": "cluster2", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type": "git", |
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
104780
1756