Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "bobbin", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "easily spool up thread-like worker processes", | ||
@@ -48,3 +48,6 @@ "main": "index.js", | ||
"sinon": "^1.12.2" | ||
}, | ||
"optionalDependencies": { | ||
"async": "^0.9.0" | ||
} | ||
} |
@@ -10,17 +10,20 @@ # bobbin | ||
var bobbin = require('bobbin'); | ||
var pool = bobbin.create(4); // create 4 processes; defaults to os.cpus().length | ||
// create 4 processes; defaults to os.cpus().length | ||
bobbin.create(4, function(err, pool) { | ||
// to send some work (in this case concatenate two strings `left' and `right'): | ||
// to send some work (in this case concatenate two strings `left' and `right'): | ||
var left = 'foo', right = 'bar'; | ||
pool.run( | ||
left, right, // you have to explicitly pass variables | ||
function remoteWorkFunction(left, right, callback) { | ||
callback(left + right); | ||
}, | ||
function localCallback(result) { | ||
assert(result === 'foobar'); | ||
} | ||
); | ||
var left = 'foo', right = 'bar'; | ||
pool.run( | ||
left, right, // you have to explicitly pass variables | ||
function remoteWorkFunction(left, right, callback) { | ||
callback(left + right); | ||
}, | ||
function localCallback(result) { | ||
assert(result === 'foobar'); | ||
} | ||
); | ||
}); | ||
``` | ||
@@ -27,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
31829
12
43
3
1