<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 20, 2014 at 1:58 AM, Ulf Wiger <span dir="ltr"><<a href="mailto:ulf@feuerlabs.com" target="_blank">ulf@feuerlabs.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A pattern I don't see mentioned often is what I might call 'orchestrator', where one process is assigned the responsibility for the overall 'script', dispatches tasks to workers and collects the results. I would say that pmap() is a simple orchestrator pattern, and a good opportunity to explain both supervision and selective receive.<br>
</blockquote><div><br></div><div>I was going to mention something like this, but didn't know what to call it; thanks Ulf! We have a bunch of them in Riak, gen_fsm processes that fanout requests to other processes and collect and coalesce the results. Here's some more patterns that should be blindingly obvious (and maybe they were already mentioned, or are too simple to mention):</div>
<div><br></div><div>Client-Server (gen_server, e.g.)</div><div>Proxy (one process mediating access to another)</div><div>Registry (finding other processes or services)</div><div>Monitor (less like a supervisor, more like just reporting on what's going on)</div>
<div><br></div></div>-- <br>Sean Cribbs <<a href="mailto:sean@basho.com" target="_blank">sean@basho.com</a>><div>Software Engineer</div><div>Basho Technologies, Inc.</div><div><a href="http://basho.com/" target="_blank">http://basho.com/</a></div>

</div></div>