adammokan

adammokan

I published a simple (but opinionated) Redis producer for Broadway that I have been using in a production system I’m wrapping up. If anyone wants to check it out and beat on it, it can be found in hex and docs are published.

Edit: see update/name change info in this post.


https://github.com/amokan/broadway_redis

TLDR - If you have things in Redis lists and want to try to process them with Broadway, it may be a fit for you. There are for sure caveats and things that can be improved, but seems to work real well so far.

Glance at the README for more info.

Showing Posts 1 to 4

adammokan

adammokan OP

Just to add a little more detail on the guts of this - for those that don’t want to dig through the README.

  • My implementation follows the ‘Reliable Queue’ pattern outlined in the Redis documentation (RPOPLPUSH | Docs). This means it relies on an RPOPLPUSH command to atomically move the item from the source list to a target ‘working’ or ‘processing’ list before returning said item to the producer. So be sure you push items to the left side of the Redis list you are working from (using LPUSH) - this assumes you doing FIFO work.
  • I handle the acknowledgement aspect of Broadway by batching Redis LREM commands to the working list.
  • Both Redis commands (RPOPLPUSH and LREM) are pipelined with sensible default batch sizes and limits.

Biggest caveat now is that you must supply the supervised Redis connection atom to the producer when starting. Maybe not a big deal, but I didn’t want to manage that in the initial release and keep it as simple as possible.

adammokan

adammokan OP

FWIW - I recently changed the library over to match the community guidelines for Broadway by renaming to off_broadway_redis.

Note the namespace changes. Outside of that, its a drop-in replacement for the OG version.

https://github.com/amokan/off_broadway_redis

dimitarvp

dimitarvp

Do you use that library for queueing and processing scraping jobs, by the way?

adammokan

adammokan OP

I’m no longer crawling/scraping the web, but I do use the Broadway library for enterprise data integrations now. Although it is not all that different - except customers pay to access an endpoint they provide.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

CodeSync
Sept 10-11, live from Chicago. Can’t make the trip? Grab a virtual pass and stream the whole thing from wherever you are. You get every ...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews