Simple RabbitMQ wrapper exposing queue functionality.
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'
})