Skip to content

Commit

Permalink
Allow to specify names for multiworkers
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcconstela committed Jul 14, 2015
1 parent 0e5983a commit 69fe54e
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 69fe54e

Please sign in to comment.