Elixir Intermediate Introduction
Elixir Intermediate builds on Elixir Beginner with deeper tools for processes, supervision, tables, fault tolerance, macros, protocols, testing, and projects. Each part adds one set of tools at a time.
Beginner tools still work
The intermediate course starts from what you already know.
name = "Elixir"
IO.puts(String.upcase(name))Small pieces combine
A list, a transform, and a sum combine into one result.
numbers = [1, 2, 3]
doubled = Enum.map(numbers, fn x -> x * 2 end)
IO.puts(Enum.sum(doubled))Processes send messages
A new process can send a message back to its parent.
parent = self()
spawn(fn -> send(parent, :ready) end)
receive do :ready -> IO.puts("ready") endExample
parent = self()
spawn(fn -> send(parent, Enum.sum([4, 5, 6])) end)
total = receive do n -> n end
IO.puts(total)
IO.puts(total * 2)Key points
- Roadmap: The course moves through processes, supervision, tables, fault tolerance, macros, protocols, testing, and projects in that order.
- Processes: The first part looks closer at how processes work together.
- Supervision: A later part covers how a system watches over its workers and restarts them.
- Tables: A later part covers fast shared tables for looking up data.
- Fault tolerance: A later part covers how a system keeps going when parts fail.
- Projects: The course ends with small projects that combine the earlier parts.
In this example, a new process sums a list and sends the total back to its parent. The parent reads the total, prints it, and then prints twice the total.
Note
Every example in this course uses only tools from Elixir Beginner or earlier lessons in this course.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does the intermediate course build on?