1.1.0 • Published 3 years ago

rabbit-message-queue v1.1.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

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

ParamTypeDescription
urlstringThe URL of the rabbit instance to connect to
tablestringThe 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

ParamTypeDescription
urlstringThe URL of the rabbit instance to connect to
tablestringThe queue name to connect to