How to retrieve GenServer state after termination ? The practical guide.

Malreddy Ankanna
blackode
Published in
9 min readApr 3, 2018

--

Fault Tolerance using Supervisors.

Supervisor | GenServer heart of application

This article is all about how to achieve the fault tolerance concept using the Supervisor in Elixir. This gonna be the lengthy reading as I tried to explain each line of code briefly.

This article is not about How the Supervisor or GenServer works.

What we gonna do here?

Here, we are going to implement Mini Banking System.

Assumption

We assume only one account holder is present in this Mini Banking System to make this simple and more understandable.

Note or Warning:

This is not a production grade application. So, consider this as just another example project to demonstrate certain real world problems.

Create the Supervisor application

$ mix new --sup bank

You can name it as you like. As our application resembles like a mini bank application with single account, I named it as Bank.

So, after creating the new application, change the directory to the application

$ cd Bank

--

--

Malreddy Ankanna
blackode

Programmer & Writer, I write about coding, thoughts, ideas, personal musings, technical articles, and tutorials.https://bio.link/blackode