Establishing Supervision Strategies
Explore how to establish supervision strategies in Elixir projects using OTP child specs. Understand the startup, restart, and shutdown policies that control worker processes and supervisors to build robust and maintainable applications. Learn to manage process dependencies and lifecycles effectively for reliable system operation.
As you’ll recall, when we build a child spec, we define the naming and lifecycle strategies our supervisors will apply to child processes. In general, this configuration code guides OTP in building the lifecycle.
Starting a worker
Let’s talk about what happens when we start a worker:
-
At startup, the worker will go down the list of child specs and start each of them using the child specs.
-
Some of those child specs will identify other supervisors or applications. Our
application.exchild list has both. -
...