导向器
警告
- 不要在你的计划中使用
'count'=>infinity和元素restart。
喜欢:
Childspec = #{id => foo
,start => {bar, baz, [arg1, arg2]}
,plan => [restart]
,count => infinity}.
如果你的进程在崩溃后没有启动,导演将锁定并重试重启你的过程 3 次! 如果你使用 infinity 作为'count',请始终在'plan'中使用 {restart, MiliSeconds} 而不是 restart。
- 如果你有以下计划:
Childspec1 = #{id => foo
,start => {bar, baz}
,plan => [restart,restart,delete,wait,wait, {restart, 4000}]
,count => infinity}.
Childspec2 = #{id => foo
,start => {bar, baz}
,plan => [restart,restart,stop,wait, {restart, 20000}, restart]
,count => infinity}.
Childspec3 = #{id => foo
,start => {bar, baz}
,plan => [restart,restart,stop,wait, {restart, 20000}, restart]
,count => 0}.
Childspec4 = #{id => foo
,start => {bar, baz}
,plan => []
,count => infinity}.
Childspec1 中 delete 元素的其余部分和 Childspec2 中其余的 stop 元素将永远无法评估!
在 Childspec3 你想要运行你的计划 0 次!
在 ChildSpec4 你没有任何计划运行 15 次!
- 当你使用
release_handler升级版本时,release_handler会调用supervisor:get_callback_module/1来获取其回调模块。
在 OTP <19get_callback_module/1中使用管理程序内部状态记录来给出其回调模块。我们的主管不知道主管的内部状态记录,然后supervisor:get_callback_module/1与主管没有合作。
好消息是,在 OTP> = 19 时,supervisor:get_callback_module/1与导演 s :) 完美配合。
1> foo:start_link().
{ok,<0.105.0>}
2> supervisor:get_callback_module(foo_sup).
foo
3>