[erlang-questions] Programming Erlang book code question

Aaron Feng aaron.feng@REDACTED
Mon Oct 22 04:22:26 CEST 2007


Hi Mateusz,

For question 2, appearently if any worker process dies, it will also cause
the supervisor to be killed.  That's why the unlink is there.  For example,
if the supervisor process is started, and you call a worker process with
incorrect number of arguments it will cause the supervisor to be killed.

You are right about question 3, it makes a lot of sense now.

For question 1, I tried out the code from the book, and I still don't
understand why the spawn is there fully.  You could be right about the
quicker initialization, but I think there's another reason for it.  If I
call the start() from the shell, I can't access the worker process that is
managed by the supervisor.  In fact, I have no idea how I can access the
worker process at all.  However if I call start_in_shell_for_testing() in
the shell, I can access the worker process like usual.

Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071021/7e53deb4/attachment.htm>


More information about the erlang-questions mailing list