Elixir內(nèi)置有四種supervision trees的容錯機制膳灶,分別是 :one_for_one, :one_for_all, :rest_for_one, :simple_one_for_one兴使。
Strategy / :one_for_one
Strategy / :one_for_all
Strategy / :rest_for_one
Strategy / :simple_one_for_one
與:one_for_one.相同优烧。但是需要實現(xiàn)Supervision.Spec。
Same as :one_for_one. But it needs to implement Supervision.Spec and you need to specify only one entry in child specification. That means every child spawned from this supervisor is the same kind of a process.
Refs
http://elixir-lang.org/docs/stable/elixir/Supervisor.html#module-strategies
https://medium.com/@mustafaturan/visualisation-of-elixir-supervision-tree-strategies-4d4cb8123138#.oo26snkdk