Skip to content
Browse files

Merge pull request #8 from aredridel/add-uniq

Add a uniq parameter to jobs
  • Loading branch information...
2 parents 14eb3f3 + 4e5c958 commit 8fc1d6abe2334f20ea04bdf64477bdb912344253 @andris9 committed Dec 13, 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 8fc1d6a

Please sign in to comment.
Something went wrong with that request. Please try again.