Supervisors
| Start a tree | |
| One for one | |
| Restart strategy | |
| Shutdown strategy |
Start a tree
The Supervisor behavior starts with start_link/2, which creates a process that immediately spawns child specifications. The tree grows downward as each child starts.
-behaviour(supervisor).
-start_link(Args).
-init([{default_one_for_one, Strategy} | Children]).
When a child crashes, the supervisor restarts it according to the RestartStrategy. The default is simple_one_for_one: the child is restarted with the same arguments.
Next: OTP applications
Article author: Arthur Isaev