how to use supervisor:start_child?
Dietmar Schaefer
dietmar@REDACTED
Tue Jan 10 12:36:14 CET 2006
Hi !
I can't get this to work !
I have a supervisor:
init([]) ->
case whereis(sup) of
undefined -> %% register only once
register(sup, self());
_ -> ok
end,
with a few ChildSpec:
AChild = {xclock,{xclock,start_link,[]},
permanent,2000,worker,[xclock]},
StopChild = {stop_wrp,{stop_wrp,start_link,[]},
permanent,2000,worker,[stop_wrp]},
SimpleSup = {dynamic, {dynamic, start_link, []},
transient, 2000, worker, [dynamic]},
{ok,{{one_for_one,1,1}, [StopChild]}}.
I I try to start_child
supervisor:start_child(sup,[{dynamic, {dynamic, start_link,
[]},transient, 2000, worker, [dynamic]}]).
I get
{error,{invalid_child_spec,[{dynamic,{dynamic,start_link,[]},
transient,
2000,
worker,
[dynamic]}]}}
How can this be?
( it should be valid because I can use it in the return value of
supervisor:init)
ok,{{one_for_one,1,1}, [SimpeSup]}}.
Please give me a hint !
regards
Dietmar
More information about the erlang-questions
mailing list