[erlang-questions] supervisor:start_child

Martin Dimitrov mrtndimitrov@REDACTED
Mon May 2 14:32:26 CEST 2011


Hi, 
  I am developing a server that needs to spawn (under supervision) multiple child processes. Since these processes will be of different gen_server type, I cannot use simple_one_of_one restart strategy. These servers are anonymous, I refer to them by their Pids.  
  The problem I get is when I try to run 2 or more servers from the same type with the same id inside the child specification. I receive already_started error. By making the ids different, everything works fine.  
  My question is why the id inside the child specification needs to be different for every process (even if it is of the same type)? What is the best practice to deal with this? Can the creation of dynamic ids be avoided?  
  Thanks,  
  Regards,  
  Martin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110502/e3c8b824/attachment.htm>


More information about the erlang-questions mailing list