2
根据Erlang文档,只要您传递进程的PID而不是子规范标识符,就可以使用supervisor:terminate_child函数和simple_one_for_one supervisors。但是,在实践中,这似乎不适用于我,而是函数返回{error,simple_one_for_one}。这里是我所看到的:Erlang simple_one_for_one supervisor terminate_child不工作
([email protected])9> supervisor:which_children(my_sup).
[{undefined,<0.544.0>,worker,[cf_server]}]
([email protected])10> P.
<0.544.0>
([email protected])11> supervisor:terminate_child(my_sup, P).
{error,simple_one_for_one}
我做错了什么,或者是Erlang文档不准确?如果我不能用supervisor:terminate_child来停止进程,我应该改用exit(P,shutdown)吗?
谢谢,这解释了它,因为我使用R13B03 :-) – Nick