Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Commit

Permalink
Adding ability to inspect a specific range of items in a queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrossman committed Jan 7, 2016
1 parent f673a88 commit b9b8c7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ exports.queue = function(name, redis) {
redis.del(name, callback);
};

/* Return an array of a range of items in the queue, sorted by score */
queue.inspectRange = function(start_i, stop_i, callback) {
redis.zrange([name, start_i, stop_i], callback);
};

/* Return an array of all items in the queue, sorted by score */
queue.inspect = function(callback) {
redis.zrange([name, 0, -1], callback);
queue.inspectRange(0, -1, callback);
};

return queue;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "zqueue",
"description": "A little redis-backed queue dingus.",
"version": "0.1.0"
"version": "0.2.0"
}

0 comments on commit b9b8c7a

Please sign in to comment.