[erlang-questions] Pratical solutions for selective send (was: gen_event handler question)

Per Melin <>
Wed May 13 23:45:28 CEST 2009


Davide Marquês:
> On the thingy I'm working on I don't really want the server process
> depending on
> any callback functions. The client "filter" should be sent as data so that
> the client
> and server code remains completely independent.
>
> At this point I'm trying to figure out what this "filter" might be and how
> to do the matching.
> It seems all the match spec ma[tch]gic is done inside ets, so I might start
> looking there. :)

Match specification module: http://www.erlang.org/doc/man/ms_transform.html

Anything you can do with a match specification you can also do with a
fun. You want data, funs are data. You can have the client pass a fun
to the server. The fun takes the message and returns true or false to
indicate whether it passed the filter.



More information about the erlang-questions mailing list