Using Agents in Elixir

In last week’s tutorial we looked at storing state in Elixir using processes. In functional programming languages, in order to maintain state you need to continuously pass it between functions. Processes allow us to store state in Elixir, possibly forever, by running an infinite loop of recursive function calls. We can then access this state […]

Continue reading...

Working with State and Elixir Processes

A couple of weeks ago we looked at working with Elixir processes. Processes are the basic unit of concurrency in Elixir. They provide isolation and allow us to build fault tolerant applications. Elixir is a functional programming language, and so this means there is no state. In order to maintain state you need to pass […]

Continue reading...

Using Tasks in Elixir

A couple of weeks ago we looked at working with processes in Elixir. To create a new process we can use the spawn/1 function. This creates a new process and executes the given function concurrently to the current process. Elixir also provides the Task module that builds upon these basic spawn functions to provide convenience […]

Continue reading...

Understanding Concurrency and Parallelism in Elixir

A couple of weeks ago we begin the next big section of learning elixir by taking a first look at processes. Processes are the foundation of many of the most attractive characteristics of elixir. Two of those characteristics are concurrency and parallelism. Processes enable these two characteristics in Elixir. In today’s tutorial we will be […]

Continue reading...

Implementing Password Reset using Ruby on Rails and Trailblazer

Allowing your users to reset their password is one of the foundational bits of functionality of just about every type of web application. It’s usually not that interesting to implement because 9 times out 10 the functionality is exactly the same for all applications. However, this makes a great example of something we can build […]

Continue reading...

Working with Processes in Elixir

Over the last couple of weeks we’ve explored many of the foundational elements of the Elixir programming language. If you are coming to Elixir from a programming language such as PHP, Ruby, or Python, you have probably already learned a lot. Elixir is a functional programming language and so it takes a new way of […]

Continue reading...

Writing Integration Tests in Ruby on Rails

In our exploration of Ruby on Rails we’ve covered testing quite a few times. It’s important to write tests at various layers of abstraction. A good test suite tests the appropriate details at each abstraction layer to provide good coverage of business rules and functionality whilst not being brittle or superfluous. The final type of […]

Continue reading...

Understanding Comprehensions in Elixir

The first time I saw a comprehension in Elixir I was a bit confused as to what the point of it was. Initially I didn’t understand why you would write a comprehension when you could achieve the same result using the existing tools that Elixir provides. It was only after digging into some Elixir code […]

Continue reading...

Using Trailblazer Cells in Action Mailer

Over the past couple of weeks we’ve been looking at building out a registration process using Trailblazer and Ruby on Rails. First we looked at Building out a User Confirmation flow in Trailblazer, and last week we looked at Confirming Users with Trailblazer. One thing we didn’t look at was adding the confirmation email that […]

Continue reading...

What are Elixir Protocols?

An important concept in programming is “polymorphism”. You may have already come across the term if you have previous experience with another programming language as just about every programming language has this concept in one form or another. Polymorphism is defined in Elixir using Protocols. We’ve already touched upon this concept a couple of times […]

Continue reading...