<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><a href="http://www.youtube.com/watch?v=R8yLKEj1WhQ&feature=related">http://www.youtube.com/watch?v=R8yLKEj1WhQ&feature=related</a><div><br></div><div>Seriously tho'. If, and when you get around to it, some of us would be ridiculously grateful, and would happily by you as much beer as you could possibly drink. Or Negronis. Whichever :-)</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div style="font-family: Helvetica; margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; "><font class="Apple-style-span" color="#1f497d" face="Calibri, sans-serif"><span class="Apple-style-span" style="font-size: 15px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(31, 73, 125); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(1, 108, 226); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(1, 108, 226); "><b><i><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(1, 108, 226); "><a href="http://www.gravatar.com/avatar/204a87f81a0d9764c1f3364f53e8facf.png"><b><i>Mahesh Paolini-Subramanya</i></b></a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(31, 73, 125); ">That Tall Bald Indian Guy...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(1, 108, 226); "><span style="text-decoration: underline; "><a href="http://dieswaytoofast.blogspot.com/">Blog</a></span><span class="Apple-converted-space"> </span> <span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); ">|<span class="Apple-converted-space"> </span> <span class="Apple-converted-space"> </span><a href="https://twitter.com/dieswaytoofast"><span style="text-decoration: underline; color: rgb(1, 108, 226); ">Twitter</span></a><span class="Apple-converted-space"> </span> <span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span> <span class="Apple-converted-space"> </span><a href="https://plus.google.com/u/0/108074935470209044442/posts"><span style="text-decoration: underline; color: rgb(1, 108, 226); ">Google+</span></a></span></div></i></b></div></div></div></span></font></div></div></span></span></div></div></div></span></div></span><font class="Apple-style-span" face="Calibri" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-weight: normal; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Calibri; color: rgb(6, 63, 244); font-size: 15px; "><u></u></div></font></div></span></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br><div><div>On Jun 6, 2012, at 9:33 AM, Ulf Wiger wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Yes, this is correct.</div><div><br></div><div>Gproc supports a few different types of register entries:</div><div><br></div><div>- names, which are unique (can be any term)</div><div>- properties, which can be held by multiple processes simultaneously</div><div>- counters, which are properties with update_counter() semantics</div><div>- aggregate counters, which maintain the sum of all counters with</div><div> the same name as the aggregate counter.</div><div><br></div><div>Properties are very useful for pub-sub, but also for highlighting various characteristics of the process. In my initial presentation of gproc, I had integrated it into OTP and modified the behaviors to register a {p,l,{behaviour,B}} property. This way, you could easily query the system for a certain type of behavior, and drill further to inspect other things.</div><div><br></div><div>(This had the unfortunate side-effect that many thought you had to have a patched OTP to use gproc. Next time, I will try to be smarter).</div><div><br></div><div>Thus, if you inspect a process, either with gproc:i(), or gproc:info(Pid [, gproc]), you can easily tell from its registered names and properties quite a bit about the process.</div><div><br></div><div>BTW, I've been thinking about adding a function, gproc:bcast(Key, Msg), which would be similar to:</div><div><br></div><div>rpc:abcast(gproc, send, [Key, Msg])</div><div><br></div><div>but with more predictable sequencing behavior, most likely making use of a gproc_bcast server to make sure all messages go the same way.</div><div><br></div><div>Wild cheers and enthusiasm may intice me to do it sooner rather than later…. ;-)</div><div><br></div><div>BR,</div><div>Ulf W</div><br><div><div>On 6 Jun 2012, at 14:50, Eric Moritz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p>Yes, if you register a property key, you can retrieve all the procs that have that property set. For instance a fanout pub/sub can be accomplished doing:</p><p>subscribe(Channel) -><br>
gproc:reg({p, l, {subscribers,<br>
Channel}}).</p><p>publish(Channel, Msg) -><br>
gproc:send({p, l, {subscribers,<br>
Channel}},<br>
Msg).</p><p>If a process calls publish/2, the message will be sent to every process that called subscribe/1.</p><p>I'm on my phone so it's a bit hard to look up the details, if you want to get a list of pids that called subscribe, look at the code of gproc:send/2. I think the function is called lookup_pids/1 but I may be wrong.</p><p>The etorrent project uses gproc. That's a good read if you want to see how to use gproc. He uses property keys for each torrent file process as well as using await to delay initialization of gen_servers that depend on other gen_servers.<br>
</p><p>Eric Moritz.<br>
</p>
<div class="gmail_quote">On Jun 6, 2012 8:27 AM, "Loïc Hoguin" <<a href="mailto:essen@ninenines.eu">essen@ninenines.eu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 05/26/2012 10:38 PM, Motiejus Jakštys wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
</blockquote>
<br>
Hello,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For term() to pid() mapping I've always used gproc. For the same thing<br>
my coworker always used pg2.<br>
<br>
I am making a comparison now. There are some features in gproc which are<br>
not in pg2:<br>
<br>
* Await for registration<br>
* Per-process properties<br>
* Aggregate counters<br>
* QLC<br>
<br>
Whereas pg2 "natively" supports mapping one key to several processes<br>
(which can be easily achieved with QLC in gproc).<br>
</blockquote>
<br>
Unless I misunderstand, gproc's properties are exactly this, mapping one key to several processes.<br>
<br>
-- <br>
Loïc Hoguin<br>
Erlang Cowboy<br>
Nine Nines<br>
______________________________<u></u>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
</blockquote></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div>Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div><a href="http://feuerlabs.com/">http://feuerlabs.com</a></div></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></body></html>