[erlang-questions] Adding a non-OTP module to a supervisor

Paul Fisher <>
Fri Feb 22 06:22:15 CET 2008


On Thu, 2008-02-21 at 22:44 -0600, Dave Bryson wrote:
> Is it possible to add a non-OTP module to the supervior strategy?
> 
> I have a module that doesn't use an OTP behavior (not  
> gen_server,gen_event, etc...). The module registers a couple of  
> processes for handling receive... after...timeout events. Can this  
> module be added as callback module to the supervisor strategy and be  
> treated as a worker?

All that is required is that the {M, F, A} provided to the supervisor in
the child specification returns {ok, pid()} when invoked.  Just create a
module that implements the supervisor behavior and return a child spec,
which starts you module.


--

paul




More information about the erlang-questions mailing list