Permalink
Browse files

just updated the readme doc to be more readable using markdown

  • Loading branch information...
1 parent 63df304 commit 7c89d9d7104d3e654503c09357cd002b4348bb45 @csanz committed Mar 28, 2011
Showing with 0 additions and 63 deletions.
  1. +0 −63 README
View
63 README
@@ -1,63 +0,0 @@
-Description
------------
-
-Node-RQueue is a simple Redis based message queue for communicating between multiple platforms.
-
-It uses a easy to implement message paradigm within Redis lists.
-
-An example message:
-
- {
- id: UUID,
- payload: 'JSON DATA',
- errors: ['HTTP 404'],
- error_count: 1
- }
-
-Messages are put onto the list with `rpush`, then the client listens for messages with the `blpop` command.
-
-Usage
------
-
-queue-server.js:
-
-// Require the node-rqueue
-var client = require('./node-rqueue');
-
-// Create the Queue with a redis server listening on localhost:6379
-var user_queue = new client.Queue({
- name: 'user',
- host: 'localhost',
- port: 6379
-});
-
-// Add a job to the queue.
-user_queue.push('Any JSON.strinify-able data goes in this parameter', function (error, id) {
- // Handle errors
- if (error) throw error;
- // Second parameter is the message/job id.
-});
-
-queue-worker.js:
-
-// Require the node-rqueue
-var client = require('./node-rqueue');
-
-// Create a worker for each queue.
-var worker = client.createWorker({
- name: 'user',
- host: 'localhost',
- port: 6379
-});
-
-// Setup message event
-worker.on('message', function (job) {
- // Process message
- process(job.payload);
-
- // Listen for next job
- worker.next();
-});
-
-// Start listening.
-worker.start();

0 comments on commit 7c89d9d

Please sign in to comment.