1.3.0 • Published 5 years ago
@robofarm/rfq v1.3.0
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/rfqimport { 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
makeStartup redis and get into a self-contained development container
make runShutdown redis and clean up networks, volumes, and containers
make downPublishing
- Increment the version in
package.json - Tag a new release with
git tag -a vx.y.zand 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).