loke-queue
v1.4.0
Published
Simple Queue
Downloads
4
Readme
loke-queue
Simple RabbitMQ wrapper exposing queue functionality.
Documentation
Example
var Connection = require('loke-queue').Connection
var connection = new Connection('amqp://localhost')
var queue = connection.queue('jobs', {maxConcurrent: 20, retryAfterMilliseconds: 10 * 60 * 1000})
queue.subscribe('demo.*', function (message) {
console.log(message)
return new Promise(function (resolve) {
setTimeout(resolve, 500)
})
})
setTimeout(function (){
queue.stop()
})
connection.publish('demo.test', {
message: 'Hello World'
})