loke-queue

1.4.0 • Public • Published

loke-queue

NPM Version Build Status

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'
})

Readme

Keywords

none

Package Sidebar

Install

npm i loke-queue

Weekly Downloads

0

Version

1.4.0

License

MIT

Last publish

Collaborators

  • aantthony