Event manager example in the book ( is it efficient ?)

20 views
Skip to first unread message

syed

unread,
Nov 1, 2010, 10:14:38 AM11/1/10
to Erlang Programming
Hi,
I started reading this book a few weeks back . I was going through the
book . I have a question about the event manager example given in
chapter 5 ( Design Patterns ) . In the code the event manager sends
every event to every event handler that has registered with the
manager . So for a very busy system with lots of events coming in , Is
it really efficient to send every event to every handler . A logic can
be implemented in the manger which will can forward events to only
those who register for it . What do you guys think ?


Thanks
-Syed

Andrey Paramonov

unread,
Nov 1, 2010, 10:45:22 PM11/1/10
to Erlang Programming
You are absolutely right. But the purpose of that example, I think, is
to show you the concept, pattern. In reality, you wouldn't implement
event streams from scratch - you would use gen_event behaviour. And if
you look at the page 291, that's what the authors briefly mention.

Andrey

Syed Mushtaq

unread,
Nov 1, 2010, 11:32:16 PM11/1/10
to erlang-prog...@googlegroups.com
Thanks a lot Andrey :)


--
Erlang Programming Website:
http://www.erlangprogramming.org/

Reply all
Reply to author
Forward
0 new messages