Break Our Application Like a Server (Part II)
Explore how to use Elixir's BEAM and Supervisor strategies to maintain application stability. Learn to kill and restart processes using the Observer tool and define acceptance tests to ensure smooth recovery in real-time Phoenix applications.
We'll cover the following...
How to kill BEAM processes with Observer
The BEAM is a resilient virtual machine. Supervisor processes monitor child processes and can be configured to handle failure differently based on the application’s needs. The most common configuration is to restart any failed child process, using the one_for_one supervisor option. The child process then initializes itself back to a healthy state. We can see this in the handle_continue callback of our Sneakers23.Inventory.Server process. If it were to crash, it would pull the current inventory from the database and continue in a healthy state. Other restart strategies are not covered in this course. The restart strategy we should use depends on the supervision structure of our application.
Designing a process tree ...