diff --git a/lib/gearman.js b/lib/gearman.js index 3fe7a43..08c5856 100644 --- a/lib/gearman.js +++ b/lib/gearman.js @@ -543,7 +543,7 @@ Gearman.prototype.Job = function(gearman, name, payload, uniq, options){ jobType += "_BG"; } - gearman.sendCommand(jobType, name, uniq ? uniq : false, payload, !options.background ? this.receiveHandle.bind(this) : false); + gearman.sendCommand(jobType, name, uniq ? uniq : false, payload, this.receiveHandle.bind(this)); }; utillib.inherits(Gearman.prototype.Job, Stream); @@ -584,6 +584,7 @@ Gearman.prototype.Job.prototype.receiveHandle = function(handle){ if(handle){ this.handle = handle; this.gearman.currentJobs[handle] = this; + this.emit("start"); }else{ this.emit("error", new Error("Invalid response from server")); } diff --git a/package.json b/package.json index 307d73e..3cc347a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "node-gearman", "description": "Simple Gearman client/worker module for Node.JS", - "version": "0.2.2", + "version": "0.2.3", "author" : "Andris Reinman", "maintainers":[ {