【发布时间】:2011-10-22 11:30:27
【问题描述】:
根据 Erlang 文档,只要传入进程的 PID 而不是子规范标识符,就可以将 supervisor:terminate_child 函数与 simple_one_for_one 监督者一起使用。但是,这在实践中似乎对我不起作用,而是该函数返回 {error, simple_one_for_one}。这是我所看到的:
(client-1@nick-desktop)9> supervisor:which_children(my_sup).
[{undefined,<0.544.0>,worker,[cf_server]}]
(client-1@nick-desktop)10> P.
<0.544.0>
(client-1@nick-desktop)11> supervisor:terminate_child(my_sup, P).
{error,simple_one_for_one}
是我做错了什么,还是 Erlang 文档不准确?如果我不能用 supervisor:terminate_child 停止进程,我应该只调用 exit(P, shutdown) 吗?
【问题讨论】:
标签: erlang