Why Supervisor.start_child dont work

筅森魡賤 提交于 2019-12-07 00:18:24

I changed the supervisor strategy for simple_one_for_one in supervisor code.

Supervisor.init([], strategy: :simple_one_for_one)

This works for me.

The second parameter of call to Supervisor.start_child/2 should be a child spec, so instead of:

Supervisor.start_child(__MODULE__, state)

it should be somewhat like:

Supervisor.start_child(__MODULE__, [self(), MyApp.MyNotifier, [state]])
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!