[erlang-questions] excute code in the supervisor when a child crashes?
Mon Oct 19 19:23:02 CEST 2009
what you actually need is an event handler. More information here:
One approach could be to append a handler process to your supervisor,
managing the ets table whenever one of the children crash.
On Oct 19, 2009, at 5:12 PM, Pablo Platt wrote:
> I have a supervisor with simple_one_for_one.
> When I start children with supervisor:start_child I save the child
> pid in an ETS table
> so I'll be able to exchange messages between all the child processes.
> When a child crashes I need to delete his pid from the ETS table or
> it'll grow constantly and eat all my memory.
> Is it possible to execute code when a child crashes or terminates?
More information about the erlang-questions