@gtanner/farm
Advanced tools
Comparing version 0.6.0 to 1.0.0
@@ -20,2 +20,3 @@ //This example shows that a worker can | ||
async.parallel([ | ||
async.apply(farm.jobs.send, 'hello'), | ||
async.apply(farm.jobs.distribute, ['hello','hello','hello']), | ||
@@ -22,0 +23,0 @@ async.apply(farm.jobs.distribute, ['hello','hello','hello']) |
@@ -21,5 +21,5 @@ var zmq = require('zmq'), | ||
async.map(payload, function (task, cb) { | ||
async.map(payload, function (task, callback) { | ||
var id = uuid.v1(); | ||
tasks[id] = { task: task, cb: cb }; | ||
tasks[id] = { task: task, callback: callback }; | ||
push.send([id, task]); | ||
@@ -75,4 +75,4 @@ }, function (err, results) { | ||
delete tasks[id]; | ||
var cb = task.cb; | ||
return cb && cb(err, result); | ||
var callback = task.callback; | ||
return callback && callback(err, result); | ||
} | ||
@@ -79,0 +79,0 @@ }); |
@@ -5,2 +5,3 @@ var zmq = require('zmq'), | ||
error = require('../error'), | ||
retryTimeout = 100, | ||
requests = [], | ||
@@ -23,6 +24,16 @@ func; | ||
var request = requests.shift(); | ||
var callback = requests.shift(); | ||
return callback && callback(err, result); | ||
switch ((err || {}).message) { | ||
case 'not_ready': | ||
case 'busy': | ||
case 'exiting': | ||
//handle "good" retryable (sp?) errors | ||
setTimeout(function () { | ||
module.exports.send(request.task, request.callback); | ||
}, retryTimeout); | ||
return; | ||
default: | ||
return request && request.callback && request.callback(err, result); | ||
} | ||
}); | ||
@@ -63,3 +74,3 @@ | ||
send: function (task, callback) { | ||
requests.push(callback); | ||
requests.push({task: task, callback: callback}); | ||
req.send(utils.serialize(task)); | ||
@@ -66,0 +77,0 @@ }, |
{ | ||
"name": "@gtanner/farm", | ||
"version": "0.6.0", | ||
"version": "1.0.0", | ||
"description": "Distributed computing orchestration platform", | ||
@@ -16,10 +16,10 @@ "homepage": "https://github.com/bithound/farm.bithound.io", | ||
"dependencies": { | ||
"async": "1.2.1", | ||
"async": "^1.4.2", | ||
"uuid": "2.0.1", | ||
"zmq": "2.11.1" | ||
"zmq": "^2.13.0" | ||
}, | ||
"devDependencies": { | ||
"sinon-chai": "2.8.0", | ||
"chai": "^2.1.0", | ||
"mocha": "^2.1.0" | ||
"chai": "^3.2.0", | ||
"mocha": "^2.3.0", | ||
"sinon-chai": "2.8.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "main": "./lib/farm", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
52086
1300
0
+ Addedasync@1.5.2(transitive)
+ Addedbindings@1.2.1(transitive)
+ Addednan@2.3.5(transitive)
+ Addedzmq@2.15.3(transitive)
- Removedasync@1.2.1(transitive)
- Removedbindings@1.1.1(transitive)
- Removednan@1.8.4(transitive)
- Removedzmq@2.11.1(transitive)
Updatedasync@^1.4.2
Updatedzmq@^2.13.0