-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Is not possible to call process.send('complete') more than once from workers.
Is there an alternative to comunicate with the compute cluster?
For example:
simple.js
#!/usr/bin/env node
const computecluster = require('../lib/compute-cluster');
// allocate a compute cluster
var cc = new computecluster({
module: './simple_worker.js'
});
var toRun = 10;
// then you can perform work in parallel
for (var i = 0; i < toRun; i++) {
cc.enqueue({}, function(err, r) {
if (err) console.log("an error occured:", err);
else console.log("it's nice:", r);
if (--toRun === 0) cc.exit();
});
};
simple_worker.js
process.on('message', function(m) {
process.send('complete');
process.send('complete');
});
the output will be: it's nice: complete 10 times, not 20.
Metadata
Metadata
Assignees
Labels
No labels