Ahoy! :)<br><br><div class="gmail_quote">On Wed, Apr 29, 2009 at 9:33 AM, Camille Troillard <span dir="ltr"><<a href="mailto:tuscland@gmail.com">tuscland@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class="gmail_quote"><div class="im">On Wed, Apr 29, 2009 at 10:17 AM, Robert Raschke <span dir="ltr"><<a href="mailto:rtrlists@googlemail.com" target="_blank">rtrlists@googlemail.com</a>></span> wrote:<br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
<div><div></div><div><br>> I would like to know if it is possible to write an event handler that would<br>
> receive only certain notifications based on a simple criteria.<br><br>
</div></div></div><div class="im">You could use a catch all like handle_event(_, State)-> at the end of<br>
your handlers? Not sure if that's the recommended way though.</div></blockquote><div><br></div><div>Yes, I thought about this, hehe.</div><div>But then all the handlers would receive notifications and should decide themselves wether or not they should process the message, which is not good.  It looks like a design issue on my side, oh well …  maybe this is not the "erlang" way to do it …</div>

<div><br></div><div>Cam</div></div>
</blockquote></div><br>After reading this I'm wondering... what's the current "erlang way" of doing selective sends?<br>
Where by "selective send" I mean:<br> - a client process sends a "message filter" to a server process;<br> - when an event occurs the server checks the client's  "message filter" to determine if a notification should be sent.<br>
<br>Looking for possible implementations for the "message filter" I found these:<br>
 - match_specs (<a href="http://erlang.org/doc/apps/erts/match_spec.html">http://erlang.org/doc/apps/erts/match_spec.html</a>)<br>
 - abstract patterns (<a href="http://www.erlang.org/eeps/eep-0029.html">http://www.erlang.org/eeps/eep-0029.html</a>)<br>From what I read the later seems more flexible in that it enables matching out-of-order elements<br>

(which comes in handy since I'm interested in a "message-based + named stuff" API).<br>
<br>Are there any solutions in the wild I can take a peek at? :)<br>
<br>
Thanks in advance!<br>
:Davide<br>