Supervisors
We've mentioned process trees several times already, and it's time we discuss them in-depth.
The GNU/Linux- and Unix-based OSes are a great example of an existing process tree that can be studied and inspected. It has a root process, typically init
with process ID 1, and it is the ancestor process of all the child processes. Each child process can itself create more child processes. The structure of this chain is a tree rooted at PID 1.
Process trees in Elixir/Erlang are not too dissimilar. There is a root process for the runtime and application controller. The applications loaded and started upon the startup of the VM are children of the application controller or immediate parent process.
However, OTP takes process trees to a new level with supervision trees. Supervision trees are similar to process trees except that they describe slightly different concepts. Process trees only describe the parent-child relationship between processes, whereas supervisor trees describe the class...