In gen_event, what functional diff does it makes for gen_event:notify & gen_event:call

Ulf Wiger <>
Thu Feb 20 13:45:03 CET 2003


On Thu, 20 Feb 2003, Suresh S wrote:

>>--- Ulf Wiger <> wrote: > On
>Thu, 20 Feb 2003, Suresh S wrote:
>
>> >how do we relate handlers and events ? i mean when
>> a
>> >request is made or an event is notified how does
>> the
>> >handler knows to handle particular event or call,
>> both in
>> >case of gen_even:notify and gen_event:call.
>
>in case of gen_event call relavent handle_call is
>called.
>gen_event:call(EntMgr, Handler, Req) -->
>M:handle_event(Req, S)

No, a call is handled in M:handle_call(Query,State)

See 'erl -man gen_event'

So, for example:

  gen_event:call(error_handler, myhandler, history)

would generate a call to

  myhandler:handle_call(history, State)


/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list