As far as I understand, a supervisor process can supervise a number of processes in Erlang/OTP behavioral model.
That processes can be gen_server
, gen_fsm,
and gen_event
. My question is that can an ordinary process become supervised by a supervisor process in Erlang/OTP? By ordinary process I mean a process that is not gen_server
, gen_fsm
, or gen_event
.
If so, how process specification will look like? I tried below but does not work:
Spec = {Id, {my_module, my_function, [Par1, ..., ParN]}, permanent, 5000, worker, [my_module]}
I also tried this:
Spec = {Id, {my_module, my_function, [Par1, ..., ParN]}, permanent, 5000, worker, []}
But when I replace the module and function with a gen_server
module and a function from inside it, this works well.
Can I conclude that a child process for a supervisor can not be an ordinary process?
Error that I get is:
Error is follow: application: myapp exited: {bad_return, {{myapp_app,start,[normal,[]]}, {'EXIT', {{badmatch, {error, {shutdown, {failed_to_start_child,worker_1, {ok,state}}}}}, [{myapp_app,start,2, [{file,"src/myapp_app.erl"},{line,27}]}, {application_master,start_it_old,4, [{file,"application_master.erl"},{line,272}]}]}}}}