I've been meaning to cover GenStage for quite a while and finally managed to. The format for this one is pretty different though. Read on.

Project

This is a session where Theron Boerner agreed to pair with me to prototype switching the rabbit-ci build queue system from RabbitMQ to GenStage. There were a few reasons that he wanted to do this:

Given this, he decided he wanted to just try implementing it in GenStage using Postgres to store the build queues. It didn't hurt that José had recently given a talk at the Elixir London meetup in which he walked through building a background job queue system using GenStage and taking advantage of a new feature in PostgreSQL 9.5 that adds support for row locking.

The code we ended up with is available on the hunterboerner/gen_stage_playground repo on GitHub.

It's a very lengthy pairing session - 2 hours and 20 minutes. With that in mind, here's a rough outline of various timings in the video:

Summary

So yeah...This is different than anything else I've released, but I think it's useful. Please email me and let me know if you liked this episode or if you hated it. I know it's a massive departure from the normal format, and I don't intend to switch to doing 2 of these a week or anything, but if there's value and people like them I'm completely willing to do them occasionally because it's a fantastic experience for me. Also, I think there needed to be some public discussion of building something slightly non-trivial with GenStage, and there hadn't really been enough of that yet, so it seemed like a useful thing to get out there.

A hybrid approach might be doing this sort of thing and then releasing the pairing session as one episode in a week, and a succinct version of the important meat we learned from it as the second episode. I'm all ears, send me an email or leave a comment and let me know what you want to see!

See you soon!

Josh Adams

I've been building web-based software for businesses for over 18 years. In the last four years I realized that functional programming was in fact amazing, and have been pretty eager since then to help people build software better.

  1. Comments for GenStage By Way of Pairing

You must login to comment

You May Also Like