Thanks, that's pretty close.  How, or more importantly, when do I register the name.  Do I put this in the child worker/sup as part of the MFA used to spawn it or can this be called by the parent once start_child has been called?  Best practice is all I'm looking for.  Thanks again for pointing this one out.<div>
<br></div><div>-Chris<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 1:03 PM, Garrett Smith <span dir="ltr"><<a href="mailto:g@rre.tt">g@rre.tt</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, Sep 7, 2011 at 9:09 PM, Christopher Wilson <<a href="mailto:wilsoncj1@gmail.com">wilsoncj1@gmail.com</a>> wrote:<br>
> Is there a way to pass a name/ID into the call to supervisor:start_child,<br>
> more specifically to init()?  I'd like to specify the name of the worker or<br>
> supervisor such that when I ran supervisor:which_children I could identify<br>
> what's what.<br>
> Also, I've tried [unsuccessfully] to dynamically create a child spec and add<br>
> pass that in.  Are there any decent examples out there on how to do this<br>
> outside of the man pages?<br>
<br>
</div></div>Take a look at:<br>
<br>
<a href="https://github.com/esl/gproc" target="_blank">https://github.com/esl/gproc</a><br>
<br>
I'm not sure if that's the canonical repository -- maybe Ulf can weigh in.<br>
<br>
It's tempting, but I find it's best not to mess with the vanilla<br>
supervisory facility and instead use gproc for getting a list of named<br>
processes. You can also use gproc to publish interesting process stats<br>
to consumers, thus avoiding costly and intrusive queries to the<br>
processes themselves.<br>
<br>
This paper:<br>
<br>
<a href="https://github.com/esl/gproc/blob/master/doc/erlang07-wiger.pdf?raw=true" target="_blank">https://github.com/esl/gproc/blob/master/doc/erlang07-wiger.pdf?raw=true</a><br>
<br>
provides the background for gproc and is otherwise an excellent read!<br>
<br>
You'll have a slight learning curve with gproc, but it's an<br>
*indispensable* tool so well worth it.<br>
<br>
It needs to be in the core :)<br>
<font color="#888888"><br>
Garrett<br>
</font></blockquote></div><br></div>