https://github.com/loopj/node-simple-redis-queue
https://github.com/loopj/node-simple-redis-queue
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/loopj/node-simple-redis-queue
- Owner: loopj
- License: mit
- Created: 2013-02-19T04:00:07.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-06-25T01:19:34.000Z (almost 13 years ago)
- Last Synced: 2025-04-15T03:55:18.905Z (about 1 year ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 15
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Simple Redis Queue for Node.js
==============================
Super simple wrapper for redis `lpush` and `brpop` commands for basic queue
processing and multiple queue support.
Usage
-----
```coffee
// Require the module
RedisQueue = require("simple-redis-queue");
// Construct a queue with a redis connection
myQueue = new RedisQueue(redisCon);
// Publish to the queue
myQueue.push("queueName", "body string or object");
// Listen for new messages
myQueue.on("message", function (queueName, payload) {
// Do something with the message
});
// Listen for errors
myQueue.on("error", function (error) {
console.error(error);
});
// Start monitoring this queue
myQueue.monitor("queueName");
```