1.0.1 • Published 6 years ago

@emartech/rabbitmq-queue-manager v1.0.1

Weekly downloads
36
License
ISC
Repository
github
Last release
6 years ago

@emartech/rabbitmq-queue-manager

queueWorker(workerId, options)

Starts a new worker with the given worker id.

To set required keys in the options, set requiredKeys in the worker's configuration as an array.

Example

const queueManager = require('@emartech/rabbitmq-queue-manager').create();

class MyWorker {

  async run() {
    queueManager.queueWorker('NextWorker', { newVar: 'foo' });
  }

}

Configuration

@emartech/rabbitmq-queue-manager uses node-config `package for configuration.

Required configuration example

{
  "RabbitMQ": "rabbitmq://connection",
  "Workers": {
    "NextWorker": {
      "requiredKeys": ["newVar"]
    }
  }
}
1.0.1

6 years ago

1.0.0

6 years ago