Do you want to pick up from where you left of?
Take me there

Lessons: Advanced

Taking our knowledge to the next level, these lessons get cover the advanced topics of Elixir and the BEAM.

OTP Concurrency

We’ve looked at the Elixir abstractions for concurrency but sometimes we need greater control and for that we turn to the OTP behaviors that Elixir is built on.

In this lesson we’ll focus on the biggest piece: GenServers

OTP Supervisors

Supervisors are specialized processes with one purpose: monitoring other processes. These supervisors enable us to create fault-tolerant applications by automatically restarting child processes when they fail.

OTP Distribution

We can run our Elixir apps on a set of different nodes distributed across a single host or across multiple hosts. Elixir allows us to communicate across these nodes via a few different mechanisms which we will outline in this lesson.

Metaprogramming

Metaprogramming is the process of using code to write code. In Elixir this gives us the ability to extend the language to fit our needs and dynamically change the code. We’ll start by looking at how Elixir is represented under the hood, then how to modify it, and finally we can use this knowledge to extend it.

A word of caution: Metaprogramming is tricky and should only be used when necessary Overuse will almost certainly lead to complex code that is difficult to understand and debug.

Umbrella Projects

Sometimes a project can get big, really big in fact. The Mix build tool allows us to split our code into multiple apps and make our Elixir projects more manageable as they grow.

Specifications and types

In this lesson we will learn about @spec and @type syntax. @spec is more of a syntax complement for writing documentation that could be analyzed by tools. @type helps us write more readable and easier to understand code.

Behaviours

We learned about Typespecs in the previous lesson, here we’ll learn how to require a module to implement those specifications. In Elixir, this functionality is referred to as behaviours.

Protocols

In this lesson we are going to look at Protocols, what they are, and how we use them in Elixir.