In this video we’re going to discuss one of the great features of using Elixir/Erlang, process supervision. To follow along, you’ll need to spin up a new mix application using mix new app_name --sup
.
We’ll create a Counter
GenServer that stores the count as state and increments and decrements it. When it crashes we no longer have access to that GenServer.
We’ll then supervise that module so that we always have a Counter
available.
Finally, we’ll discuss the multiple ways we can add a supervisor to our application.ex
as well as cover how we can use a module based Supervisor instead.
Get notified of any new episodes as we release them.