Permalink
Browse files

queue poll fix

  • Loading branch information...
1 parent d2ad51c commit d2ec2aeecf181611dc6cf748e7e28bc791436809 @pofallon committed Jul 17, 2012
Showing with 4 additions and 6 deletions.
  1. +3 −5 lib/queue.js
  2. +1 −1 package.json
View
@@ -103,7 +103,7 @@ Queue.prototype.get = function(callback) {
if (err) {
callback(err);
} else if (messages.length > 0) {
- callback(null, messages[0], function() {
+ callback(null, messages[0].messagetext, function() {
that.del(messages[0]);
});
} else {
@@ -183,13 +183,11 @@ Queue.prototype.poll = function(opts, t) {
if (t > 0) {
this.interval = setInterval(function() {
- that.get(function(err,msg) {
+ that.get(function(err, msg, done) {
if (err) {
that.emit('error',err);
} else if (msg) {
- that.emit('message',msg[0], function() {
- that.del(msg[0]);
- });
+ that.emit('message',msg, done);
}
});
},t);
View
@@ -23,7 +23,7 @@
"loremipstream" : "0.0.x"
},
"engine": "node >= 0.6.0",
- "version": "0.6.1",
+ "version": "0.6.2",
"files": [
"index.js",
"lib",

0 comments on commit d2ec2ae

Please sign in to comment.