@robofarm/rfq

Reliable message queues on top of redis

Usage no npm install needed!

<script type="module">
  import robofarmRfq from 'https://cdn.skypack.dev/@robofarm/rfq';
</script>

README

rfq.js

Javascript/Typescript integration for a simple reliable queue rfq

Table of Contents

  1. Overview
  2. Usage
  3. Development
  4. Publishing
  5. License

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 then git push origin vx.y.z
  • In the container, export NPM_TOKEN="" and then npm publish

License

Copyright © 2020 robofarm

Distributed under the MIT License (MIT).