Skip to content

Commit

Permalink
Merge pull request #85 from joseuserpath/feature/multiworker_name
Browse files Browse the repository at this point in the history
Allow to specify names for multiworkers
  • Loading branch information
evantahler committed Jul 14, 2015
2 parents 0e5983a + 69fe54e commit 01891f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/multiWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var multiWorker = function(options, jobs, callback){
self.jobs = jobs;
self.running = false;
self.working = false;
self.name = self.options.name;
self.eventLoopBlocked = true;
self.eventLoopCheckCounter = 0;
process.nextTick(function(){
Expand Down Expand Up @@ -45,6 +46,7 @@ multiWorker.prototype.defaults = function(){
checkTimeout: 500,
maxEventLoopDelay: 10,
toDisconnectProcessors: true,
name: os.hostname()
};
};

Expand All @@ -55,7 +57,7 @@ multiWorker.prototype.startWorker = function(callback){
connection: self.options.connection,
queues: self.options.queues,
timeout: self.options.timeout,
name: os.hostname() + ":" + process.pid + '+' + id
name: self.options.name + ":" + process.pid + '+' + id
}, self.jobs, function(){
worker.workerCleanup();
worker.start();
Expand Down

0 comments on commit 01891f8

Please sign in to comment.