문제

I see from the Erlang docs that supervisor:start_child can return two different non-error results: {ok, Child} and {ok, Child, Info}. Where does this Info get set? Is it different for simple_one_for_one sups as opposed to others? I haven't been able to find an example / documentation on this...

도움이 되었습니까?

해결책

Info comes from the function that starts the child process (as given in the child specification in the supervisor). Most of the time, that function will eventually call gen_server:start_link/4 which only returns {ok, Pid} and never {ok, Pid, Info}, so that case only applies when you have a custom function for spawning the process, probably using the functions in the proc_lib module.

Processes that don't use a pre-defined behaviour are called "special processes" and are described in the OTP Design Principles User's Guide.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top