Skip to content

Commit

Permalink
simplified code to be compatible with node 4
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Sep 11, 2017
1 parent 823f854 commit 43a90e2
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions lib/process/master.js
Expand Up @@ -59,22 +59,12 @@ process.on('message', function(msg) {
}
});

var jobHandler = {
get: function(target, name) {
if(name === 'progress'){
return function(progress){
process.send({
cmd: 'progress',
value: progress
});
};
}else{
return target[name];
}
}
};

function wrapJob(job){
var proxy = new Proxy(job, jobHandler);
return proxy;
job.progress = function(progress){
process.send({
cmd: 'progress',
value: progress
});
};
return job;
}

0 comments on commit 43a90e2

Please sign in to comment.