Queued client for Node.js
var queued = require('queued');
var client = queued('http://localhost:5353', { auth: '...' });
var queue = client.queue('testing');
Producer:
queue.enqueue('foo', function (err, item) {
...
});
Consumer:
queue.dequeue({ timeout: 10, wait: 30 }, function (err, item) {
if (err) throw err;
console.log(item.value);
item.complete(function (err) {
if (err) throw err;
});
});
$ npm install queued