rabbit-message-queue
v1.1.0
Published
An implementation of [abstract-message-queue](https://www.npmjs.com/package/abstract-message-queue) for a [RabbitMQ](https://www.rabbitmq.com/) backend.
Downloads
2
Maintainers
Readme
Rabbit Message Queue
An implementation of abstract-message-queue for a RabbitMQ backend.
In short, creates an async iterator that acts as a worker queue.
Uses the for await of
pattern for resource cleanup.
To use:
import RabbitMessageQueue from 'rabbit-message-queue';
for await(const queue of RabbitMessageQueue.connect('amqp://://localhost:5672', 'my_queue')) {
await myApplicationThatUsesAbstractMessageQueue(queue);
}
For more details on how to use the queue
instance, see the
abstract-message-queue README.
Dependencies
- abstract-message-queue: ^1.0.0
- rabbit.js: ^0.4.4
rabbit-message-queue
Rabbit Message Queue
See: default
rabbit-message-queue.default
Kind: static property of rabbit-message-queue
rabbit-message-queue.connect(url, table)
Connect to rabbit and yield an instance of the message queue
Kind: static method of rabbit-message-queue
| Param | Type | Description | | --- | --- | --- | | url | string | The URL of the rabbit instance to connect to | | table | string | The queue name to connect to |
rabbit-message-queue.sender(url, table)
Connect to rabbit and yield a function for adding a message to the queue
Kind: static method of rabbit-message-queue
| Param | Type | Description | | --- | --- | --- | | url | string | The URL of the rabbit instance to connect to | | table | string | The queue name to connect to |