Last active
April 19, 2017 18:08
-
-
Save vvo/5eb82f19f061353080dd534ac3009a67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var workers = [ | |
{name: 'worker1', fn: function(task, cb) {/* some async processing */}}, | |
{name: 'worker2', fn: function(task, cb) {/* some async processing */ }} | |
]; | |
var tasks = ['one']; // this will be filled with a first task and then filled with more tasks from the workers | |
// I want to distribute tasks to workers, each worker can process only one task at a time | |
// workers will add more tasks while processing | |
// in some situations tasks may be empty and all workers processing | |
// in some situations tasks will not be empty and all workers will be processing | |
// When there's one error, I just want to be notified | |
// Any module can be used, I am using Node.JS latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment