Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gtanner/farm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gtanner/farm - npm Package Compare versions

Comparing version 0.6.0 to 1.0.0

1

examples/notready.js

@@ -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'])

8

lib/broker/pushpull.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc