Digests » 187

this week's favorite

Rewriting a Ruby/Rails app in Elixir/Phoenix (almost) Literally

I have been looking for a somewhat challenging app apart from the simple demos to write in Elixir using Phoenix framework for quite sometime. Having Ruby/Rails familiarity, I picked the Ruby on Rails Tutorial — Learn Web Development with Rails (https://www.railstutorial.org) by Michael Hartl (in fact, I learned Rails reading this tutorial!) and decided to convert the twitter like Sample App presented pretty much throughout the tutorial.

Using tuple-wrapping to improve `with` expressions in Elixir

Wrap your return values in tuples so you can clearly match them in the else block.

Distributed Phoenix Chat using Redis PubSub

In this article we see how to solve an issue we faced in the previous article, scaling horizontally the Phoenix Chat app. We'll see how to integrate the PubSub Redis adapter to our chat app, and make it distributed.

Implementing Connection Draining for Phoenix (or any library that uses Ranch!)

This is a problem that many of us are familiar with. We would like to deploy our programs, and deploying a new version requires turning off the old version (unless you are using hot code swapping, but that’s another kettle of fish). So you send a SIGTERM to your server, and since everything works well, it stops accepting new requests, and waits for some period of time to give the in flight requests a chance to finish. (Right?)

How to get a struct's type in Elixir

There are a couple of ways to retrieve the type of a struct in Elixir.