<div dir="ltr">Oliver, gproc looks exactly right; thanks for the pointer! I just didn't know about it, so essentially I was building my own with very limited features. <span style="line-height:1.5">Pardon my ignorance. I've been working in Erlang for a little over 2 years, and I only just feel like I have a handle on how everything fits together. I still don't know what all libraries are out there to do common jobs.</span><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Hmm, that seems like a good subject for a fresh thread...</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, May 14, 2016 at 12:16 PM Oliver Korpilla <<a href="mailto:Oliver.Korpilla@gmx.de">Oliver.Korpilla@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, Ryan.<br>
<br>
Isn't this normally the job of a registry like gproc or am I misunderstanding your requirements?<br>
<br>
I usually start the worker dynamically through the supervisor and let it do its own registration.<br>
<br>
Cheers,<br>
Oliver<br>
 <br>
<br>
Gesendet: Samstag, 14. Mai 2016 um 18:57 Uhr<br>
Von: "Ryan Stewart" <<a href="mailto:zzantozz@gmail.com" target="_blank">zzantozz@gmail.com</a>><br>
An: "Loïc Hoguin" <<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>>, Chandru <<a href="mailto:chandrashekhar.mullaparthi@gmail.com" target="_blank">chandrashekhar.mullaparthi@gmail.com</a>><br>
Cc: "Erlang-Questions Questions" <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>><br>
Betreff: Re: [erlang-questions] simple_one_for_one supervisor - what happens at restart? (also: gen_tcp)<br>
<br>
On Sat, May 14, 2016 at 3:28 AM Loïc Hoguin <<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>> wrote:The primary function of supervisors is to provide a hierarchy of<br>
processes belonging to an application. With such a hierarchy it becomes<br>
possible to find and query information about any single process in your<br>
system in a standard manner.<br>
 <br>
I'm rather interested in this aspect of supervised processes. Especially in the case of a simple_one_for_one supervisor, it's unlikely that the supervised processes will be registered, and it's possible that there could be a rather large number of them--maybe in the tens or hundreds of thousands, depending on the use case. I'm curious how others deal with finding a specific temporary process if, for instance, you want to check on the progress of the work it's doing.<br>
 <br>
My current solution is to have a locally registered "manager" process as a supervised sibling to the SOFO worker supervisor, and the manager just has a dict that maps UUIDs to worker PIDs. I.e. creating a "worker" process entails both a supervisor:start_child() call and storing the worker id -> pid mapping in the manager. Is this a typical way to handle temporary workers?_______________________________________________ erlang-questions mailing list <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a> <a href="http://erlang.org/mailman/listinfo/erlang-questions%5Bhttp://erlang.org/mailman/listinfo/erlang-questions%5D" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions[http://erlang.org/mailman/listinfo/erlang-questions]</a><br>
</blockquote></div>