Shutting down a simple child

Vance Shipley <>
Mon Jun 28 21:24:44 CEST 2004


In the case of a simple_one_for_one supervisor you cannot
use terminate_child/2.  I'd like to use a simple supervisor
and dynamically start child supervisors.  The problem I am
having is in shutting down those supervisors.  In the case
of a one_for_one supervisor you can use terminate_child/2
but that requires a child Id which is undefined in a simple
supervisor.  When I try to do exit(ChildSup, shutdown) it 
is just ignored.  I've been looking at the supervisor.erl
module but so far can't figure out what terminate_child/2
is doing differently.

Ideally I'd like these dynamically added supervisors to be
transient so that I can do an explicit shutdown but they 
would be restarted automatically if they terminated
abnormally.  Is this possible?

	-Vance



More information about the erlang-questions mailing list