Introduce DynamicSupervisor
Explore how to introduce and use DynamicSupervisor in Elixir to manage GenServer processes on demand. Understand the importance of the start_link/1 function, how to add DynamicSupervisor to your supervision tree, and troubleshoot common errors that arise during dynamic process management.
The DynamicSupervisor supervisor
DynamicSupervisor is another ready-to-use supervisor available to us. It can
start any GenServer process on demand. Let’s add it to the supervision tree:
The strategy setting is required, and the only currently accepted strategy is :one_for_one. We talk about supervisor strategies later in this chapter, so we don’t need to worry about this for now.
The module-based DynamicSupervisor supervisor
We can also define a DynamicSupervisor module as we see in the later lessons. Instead of use ...