Browse files

Add a uniq parameter to jobs

  • Loading branch information...
1 parent 14eb3f3 commit 4e5c9582f20d8157f10fe01f62a8e1813aba4007 Aria Stewart committed Dec 8, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/gearman.js
View
8 lib/gearman.js
@@ -473,8 +473,8 @@ Gearman.prototype.registerWorker = function(name, func){
this.workers[name] = func;
};
-Gearman.prototype.submitJob = function(name, payload){
- return new this.Job(this, name, payload);
+Gearman.prototype.submitJob = function(name, payload, uniq){
+ return new this.Job(this, name, payload, uniq);
};
// WORKER
@@ -520,7 +520,7 @@ Gearman.prototype.Worker.prototype.error = function(error){
// JOB
-Gearman.prototype.Job = function(gearman, name, payload){
+Gearman.prototype.Job = function(gearman, name, payload, uniq){
Stream.call(this);
this.gearman = gearman;
@@ -529,7 +529,7 @@ Gearman.prototype.Job = function(gearman, name, payload){
this.timeoutTimer = null;
- gearman.sendCommand("SUBMIT_JOB", name, false, payload, this.receiveHandle.bind(this));
+ gearman.sendCommand("SUBMIT_JOB", name, uniq ? uniq : false, payload, this.receiveHandle.bind(this));
};
utillib.inherits(Gearman.prototype.Job, Stream);

0 comments on commit 4e5c958

Please sign in to comment.