@robofarm/rfq
v1.3.0
Published
Reliable message queues on top of redis
Downloads
107
Readme
Table of Contents
Overview
We are using redis as a message queue to communicate between services, backends, workers. Implementing a reliable message queue with redis is possible but has to follow certain best practices.
The goal of this project is to provide a simple reliable message queue on top of redis while following best practices and capturing conventions as code. See rfq for the main project, messaging queue management tools, and more details.
Usage
npm install @robofarm/rfq
import { Queue } from "@robofarm/rfq";
q = new Queue();
await q.publish("mytopic", { "mykey": "myval" });
const task = await q.consume("mytopic");
console.log(task.value);
await task.resolve();
Development
We provide a docker-compose setup for local development.
Build the docker images
make
Startup redis and get into a self-contained development container
make run
Shutdown redis and clean up networks, volumes, and containers
make down
Publishing
- [ ] Increment the version in
package.json
- [ ] Tag a new release with
git tag -a vx.y.z
and thengit push origin vx.y.z
- [ ] In the container,
export NPM_TOKEN=""
and thennpm publish
License
Copyright © 2020 robofarm
Distributed under the MIT License (MIT).