[erlang-questions] Pratical solutions for selective send (was: gen_event handler question)
Wed May 13 23:18:29 CEST 2009
> After reading this I'm wondering... what's the current "erlang way" of
> > selective sends?
> > Where by "selective send" I mean:
> > - a client process sends a "message filter" to a server process;
> > - when an event occurs the server checks the client's "message filter"
> > determine if a notification should be sent.
> I don't understand what's wrong with gen_event in this case? An event
> handler is not its own process. It's just a callback module. There is
> only one process and that's the event manager. Using a catch-all
> handle_event/2 should be an extremely cheap way to disregard events
> you're not interested in. Not that I have run any benchmarks.
In Camille's case I agree gen_event is just fine. But I'd call that case a
in opposition to the "selective send" (involving two processes) that I'm
looking for. :)
On the thingy I'm working on I don't really want the server process
any callback functions. The client "filter" should be sent as data so that
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. :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions