cluster-service
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -1,4 +0,15 @@ | ||
module.exports = function(evt, cb) { | ||
module.exports = function(evt, cb, cmd) { | ||
var workers = evt.service.workers; | ||
var ret = { workers: workers }; | ||
var ret = { }; | ||
cmd = cmd || "simple"; | ||
switch (cmd) { | ||
case "details": | ||
ret.workers = workers; | ||
break; | ||
default: | ||
ret.workers = workerSummary(workers); | ||
break; | ||
} | ||
cb(null, ret); | ||
@@ -9,5 +20,25 @@ }; | ||
cb(null, { | ||
command: "workers", | ||
info: "Returns list of active worker processes." | ||
command: "workers [simple|details]", | ||
info: "Returns list of active worker processes.", | ||
"simple|details": "Defaults to 'simple'.", | ||
"* simple": "Simple overview of running workers.", | ||
"* details": "Full details of running workers." | ||
}); | ||
}; | ||
function workerSummary(workers) { | ||
var ret = []; | ||
for (var i = 0; i < workers.length; i++) { | ||
var w = workers[i]; | ||
ret.push({ | ||
id: w.id, | ||
pid: w.pid, | ||
state: w.state, | ||
worker: w.cservice.worker, | ||
cwd: w.cservice.cwd | ||
}); | ||
} | ||
return ret; | ||
} |
var | ||
cservice = require("../cluster-service") | ||
cservice = require("../cluster-service") | ||
; | ||
@@ -20,2 +20,5 @@ | ||
if (cservice.options.cli === true && cservice.options.debug) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
var args = Array.prototype.slice.call(arguments); | ||
@@ -38,2 +41,5 @@ for (var i = 0; i < args.length; i++) { | ||
if (cservice.options.cli === true && cservice.options.log) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
var args = Array.prototype.slice.call(arguments); | ||
@@ -51,2 +57,5 @@ if (args.length > 0 && typeof args[0] === "string" && args[0][0] === "{") { | ||
if (cservice.options.cli === true && cservice.options.error) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
var args = Array.prototype.slice.call(arguments); | ||
@@ -53,0 +62,0 @@ for (var i = 0; i < args.length; i++) { |
{ | ||
"name": "cluster-service", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Aaron Silvas", |
@@ -27,3 +27,3 @@ var cservice = require("../cluster-service"); | ||
assert.equal(obj.info, "Returns list of active worker processes."); | ||
assert.equal(obj.command, "workers"); | ||
assert.equal(obj.command, "workers [simple|details]"); | ||
done(); | ||
@@ -30,0 +30,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
76013
1932