<DIV>Hello Wiger, </DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>-> Thus, each event handler can choose to match <SPAN class=858103508-22102004><FONT face=Arial size=2>on every event that comes in</FONT></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV>here in this case i only need 'one event handler' </DIV>
<DIV> </DIV>
<DIV>Ok fine, then i need only one event handler,  and 'N' different functions defined to handle </DIV>
<DIV>'N' different events,  </DIV>
<DIV> </DIV>
<DIV>Thanking you .</DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>suresh saragadam</FONT></DIV>
<DIV><FONT color=#0000ff><SPAN class=858103508-22102004></SPAN></FONT> </DIV>
<P><B><I>"Ulf Wiger (AL/EAB)" <ulf.wiger@ericsson.com></I></B> wrote:</P>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>Hi Suresh,</FONT></SPAN></DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>You only need one handler and one module, regardless of the number of events.</FONT></SPAN></DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>Gen_event works such that for each incoming event, the function handle_event(Event, State) </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>is called in every installed event handler. Thus, each event handler can choose to match </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>on every event that comes in, or perhaps only on one or a few. It's of course important </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>to have a catch-all clause, so that the handler doesn't crash if a new event is introduced.</FONT></SPAN></DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>The only real point to having several different event handler modules is if you have </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>several different _types_ of event handler. Multiple instances could for example be </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>used if you have an event handler that filters events and sends messages to a worker </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>process; the worker process could then install and supervise its own instance of a </FONT></SPAN><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>generic handler.</FONT></SPAN></DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=858103508-22102004><FONT face=Arial color=#0000ff size=2>Uffe</FONT></SPAN></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> owner-erlang-questions@erlang.org [mailto:owner-erlang-questions@erlang.org]<B>On Behalf Of </B>suresh saragadam<BR><B>Sent:</B> den 21 oktober 2004 05:41<BR><B>To:</B> Erlang<BR><B>Subject:</B> How to make use of gen_event behaviour<BR><BR></FONT></DIV>
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>A  small clarification about gen_event behaviour, </DIV>
<DIV> </DIV>
<DIV>For suppose i have 25 different events to be handled,  </DIV>
<DIV> </DIV>
<DIV>If i am implementing gen_event behaviour, i should have 1 event manager,</DIV>
<DIV> </DIV>
<DIV>and 25 event handlers,</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV>As event handler is implemented as a callback module, </DIV>
<DIV> </DIV>
<DIV>I should have 25 callback modules. </DIV>
<DIV> </DIV>
<DIV>When ever an event occurs particular event handler is called as a call back module</DIV>
<DIV> </DIV>
<DIV>am i correct</DIV>
<DIV> </DIV>
<DIV>if i have '100 events' i should have '100 event handlers' implemented as call back modules</DIV>
<DIV>i.e '100 moudles' (each one for one event)</DIV>
<DIV> </DIV>
<DIV>sureshsaragadam</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>  </DIV>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR><A href="http://vote.yahoo.com/">vote.yahoo.com</A> - Register online to vote today</BLOCKQUOTE></BLOCKQUOTE><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com