SimpleQueue
Simple in-memory queue for Node.js. It can be accessed by remote clients.
Installation
Via npm on Node:
npm install simplequeue
Reference it from your program:
var simplequeue = ;
Local Usage
Create queue, put and get message:
var sq = ; // .... var queue = sq;queue; // .... var newmessage = queue; // null if no message // now, newmessage contains 'my daya' // put another message queue; // .... // get the message with a callback queue;
There is a local Queue Server
var sq = ;var server = ;
Then, you can create a Queue by name
var queue = server;
If the queue already exists, the original queue is returned.
To get an existent queue
var queue = server;
If the queue doesn't exist, null is returned.
Remote Usage
Server side:
var localserver = sq; var server = sq;server;
If you don't need a reference to the local server, it can be omitted:
var server = sq;server;
Client side:
var client = sq; client; client;
Development
git clone git://github.com/ajlopez/SimpleQueue.git
cd SimpleQueue
npm install
npm test
Samples
- Local Producer and Consumers Sample demostrating how to launch one producer and two consumers sharing a queue.
- Distributed Producers and Consumers Using a central queue server from distributed producers and consumers.
Versions
- 0.0.1: Published.
- 0.0.2: Published. More factory methods exposed, instead of direct 'classes'. It uses a new version of SimpleRemote (0.0.3)
- 0.0.3: Published. Engine range update; it uses SimpleRemote 0.0.4
- 0.0.4: Published. Using SimpleRemote 0.0.5
Contribution
Feel free to file issues and submit pull requests � contributions are welcome.
If you submit a pull request, please be sure to add or update corresponding
test cases, and ensure that npm test
continues to pass.