[erlang-questions] how: notify a static child when a supervisor restarts

Chandru <>
Fri Nov 30 15:07:50 CET 2007


On 30/11/2007, Jim McCoy <> wrote:
> I have a supervisor with one static child and a variable number of
> dynamic children that are added (by the static child) once the
> supervisor starts running.  According to the docs, if the supervisor
> restarts the dynamic children are toast.  Since the static child,
> which is basically a manager for the dynamic child processes, has the
> info it needs to re-inject the dynamic child specs I was not too
> worried when I started coding things.  Where I am running into
> problems is catching the supervisor restart.  Do I need to link the
> static child to the super and trap its exits or am I missing
> something?
>

If you supervisor has restarted, the static child will be killed and
respawned by the supervisor. Your static child then spawns all the
dynamic ones at startup. Or have I missed the point?

cheers
Chandru



More information about the erlang-questions mailing list