I have a dynamic spawning of workers in a surveillance tree that happens at http://github.com/noss/iserve . The iserve application has a registered process that I call iserve_master , it is monitored along with a simple mode manager for one.
iserve_master designed to request the start of the http server. It can have several servers if they are tied to unique addresses. Running servers build a name for themselves, but to simplify debugging, it generates an atom using the port name.
A server is an โeternalโ loop waiting for iserve_socket call back after accepting a connection. It runs the first in init.
A running socket is not monitored because it cannot be restarted without losing the connection to the http connection. And I see this as part of a function that doesn't care. Fire and forget.
This is far from ideal, but an architecture that I like.
source share