0
試圖通過其PID終止一個孩子沒有工作的孩子,就應該根據文檔:https://hexdocs.pm/elixir/1.3.3/Supervisor.html#terminate_child/2主管:不能終止通過PID
iex(7)> {:ok, sup} = Supervisor.start_link([], strategy: :one_for_one)
{:ok, #PID<0.383.0>}
iex(8)> {:ok, pid} = Supervisor.start_child(sup, worker(RData.ExpectedRefurbishmentCost, [self()]))
{:ok, #PID<0.385.0>}
iex(9)> Supervisor.terminate_child(sup, pid)
{:error, :not_found}
任何線索,使其工作?
文檔說,你需要通過子ID的所有策略,除了'simple_one_for_one' 。 PID僅適用於'simple_one_for_one'。 – Dogbert
我超越了...... THX的精度:) – knotito