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

darkskyapp/zqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

zqueue

A little redis-backed queue dingus.

var zqueue = require('zqueue')
var redis = require('redis').createClient(...)

// Create a new queue
var queue = zqueue.queue('myQueueName', redis)

// Add items to the queue (providing a "priority" for each)
queue.add([item0, itemPriority0, item1, itemPriority1, ...], function(err) {
  // ...
})

// Grab the next item (ordered by priority)
queue.pop(function(err, item) {
  // ...
})

// Remove items from the queue
queue.remove([item0, item1, ...], function(err) {
  // ...
})

// Empty the queue
queue.empty(function() {
  // ...
})

// Get a list of all items in the queue, sorted by priority
queue.inspect(function(err, item) {
  // ...
})