redis-ccp-queue
Advanced tools
Comparing version
{ | ||
"name": "redis-ccp-queue", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A simple and lightweight Competing Consumers Pattern Queue", | ||
@@ -28,6 +28,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"eyes": "^0.1.8", | ||
"inspect": "0.0.2", | ||
"ioredis": "^1.15.1" | ||
} | ||
} |
@@ -52,3 +52,3 @@ # redis-ccp-queue | ||
function handleMessage(data, done) { | ||
console.log('CONSUMER ' + id + ':'); | ||
console.log('CONSUMER:'); | ||
console.log(data); | ||
@@ -112,17 +112,17 @@ done(); // call done() when message is handled | ||
-------------- -------------- | ||
| Producer 2 | ---> ---> | Consumer 1 | | ||
-------------- -------------- | ||
-------------- -------------- | ||
| Producer 2 | ---> ---> | Consumer 1 | | ||
-------------- -------------- | ||
-------------- ------------------------------------- -------------- | ||
| Producer 3 | ---> | ------ ------ ------ ------ | ---> | Consumer 2 | | ||
-------------- | | M5 | | M4 | | M3 | ....> | M1 | | -------------- | ||
| ------ ------ ------ ------ | | ||
. ------------------------------------- . | ||
. Message Queue (FIFO) . | ||
. . | ||
-------------- ------------------------------------- -------------- | ||
| Producer 3 | ---> | ------ ------ ------ ------ | ---> | Consumer 2 | | ||
-------------- | | M5 | | M4 | | M3 | ....> | M1 | | -------------- | ||
| ------ ------ ------ ------ | | ||
. ------------------------------------- . | ||
. Message Queue (FIFO) . | ||
. . | ||
-------------- -------------- | ||
| Producer x | ---> ---> | Consumer n | | ||
-------------- -------------- | ||
-------------- -------------- | ||
| Producer x | ---> ---> | Consumer n | | ||
-------------- -------------- | ||
@@ -148,3 +148,3 @@ -------------- | ||
| -------------- | ------- | | ||
| new ccpq.Producer(queueName [, options]) | expects an Queue-Name and (optional) Redis Options *) | | ||
| new ccpq.Producer(queueName [, options]) | expects an queue name and (optional) Redis Options *) | | ||
| push(data) | push data to the queue. This can be either a string or an JSON object | | ||
@@ -157,3 +157,3 @@ | shutdown() | disconnects safely from Redis | | ||
| -------------- | ------- | | ||
| new ccpq.Consumer(queueName, callback [, options]) | expects an Queue-Name, your callback function (where you handle/consume the data from the queue) and (optional) Redis Options *) | | ||
| new ccpq.Consumer(queueName, callback [, options]) | expects a queue name, your callback function (where you handle/consume the data from the queue) and (optional) Redis Options *) | | ||
| shutdown() | disconnects safely from Redis | | ||
@@ -160,0 +160,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42324
7.42%1
-66.67%18
5.88%- Removed
- Removed
- Removed
- Removed