This is a simple example of how to use Redis to implement a leader election algorithm in Ruby.
$ make setup $ foreman start 1 $ foreman start 2
You can then kill the leader and observe a follower being elected as the new leader.