Skip to content

Commit

Permalink
Return the created ID when pushing to a queue
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Feb 21, 2011
1 parent de3bd49 commit 59c8a19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -61,9 +61,11 @@ exports.Queue = Queue;
Queue.prototype.push = function (payload, callback) {
var self = this;

var id = uuid();

// Push the job.
self.client.rpush(self.prefix + 'queue:' + self.name, JSON.stringify({
id: uuid(),
id: id,
payload: payload,
error_count: 0,
errors: [],
Expand All @@ -75,6 +77,8 @@ Queue.prototype.push = function (payload, callback) {

if (callback) callback(null, id);
});

return id;
};


Expand Down

0 comments on commit 59c8a19

Please sign in to comment.