Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function doWorker(arr, callback) {
var responses = {};
arr.wait(function(name, next) {
var worker = F.worker(name, name);
worker.on('message', function(obj) {
// Save the message
responses[name] = obj;
// We have a result, continue ...
if (obj) {
next();
return;
}
// Error?
if (callback) {
next = null;
callback(new Error('SHIT'), responses);
return;
}
});
}, function() {
callback(null, responses);
});
}
doWorker(['remove_photo_sets', '3d_sk', 'enviroment_textures', 'female_anatomy', 'human_anatomy', 'photo_reference', 'scans'], function(err, response) {
console.log(err, response);
console.log('done');
});
@tomee03

This comment has been minimized.

Copy link

tomee03 commented Mar 10, 2016

funguje to :) este raz dik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.