Permalink
Browse files

Add method to read stored keys from a job

  • Loading branch information...
1 parent f0bf563 commit 2ea210f76b5df2253f79c862d611fe2bdf7e9b81 @scinos scinos committed Sep 30, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/queue/job.js
View
@@ -307,6 +307,20 @@ Job.prototype.set = function(key, val, fn){
};
/**
+ * Get job `key`
+ *
+ * @param {String} key
+ * @param {String} fn
+ * @return {Job} for chaining
+ * @api public
+ */
+
+Job.prototype.get = function(key, fn){
+ this.client.hget('q:job:' + this.id, key, fn || noop);
+ return this;
+};
+
+/**
* Set the job progress by telling the job
* how `complete` it is relative to `total`.
*

0 comments on commit 2ea210f

Please sign in to comment.