Elixir Supervision Tree 策略可视化

Elixir内置有四种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.相同。但是需要实现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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容