trivelop @rrrene on

Pour me an Inch of that Elixir

I recently announced the addition of Build History to Inch CI. I did not disclose however that Elixir played a vital part in this.

Inch CI

Build History gives you an overview of what changed over time regarding Inch’s evaluation. It does so in real-time and that magic is provided by Gossip, a socket server that uses Phoenix Channels for passing messages between Inch CI’s worker processes and connected clients.

The idea is simple: We can use Phoenix Channels to publish “build events” to all subscribed clients via PubSub. The events are received by JavaScript-clients, which then change the currently displayed build history.

The workers on the other hand can “ping” the Gossip server with a simple HTTP request to signal events that are taking place. As you may have noticed, these clients and workers are not written in Phoenix or Elixir, nor do they need to be, since the used technologies are all based on open technology/standards.

This way, it was easy to connect the existing infrastructure (Rails web app, Ruby workers and its JS-flavored frontend) with the new Gossip server written in Elixir.

The result: builds appear auto-magically in the history of a project whenever a build starts, updates or finishes. It’s like magic.

Read all about Phoenix Channels and if you haven’t, give Elixir a try.

Fork me on GitHub