[erlang-questions] Re: gen_event help

Robert Virding robert.virding@REDACTED
Fri Jan 28 11:11:40 CET 2011


Have you added the handler using test:add_handler(). The test:start_link() only starts the event manager, you need to give it something to do by explicitly adding handlers, even if they are in the same module. Which is not always good practice, even if alarm_handler does it.

Two links about event handlers from the on-line docs:

>From the Design Principles section: http://www.erlang.org/doc/design_principles/events.html

And the gen_event module: http://www.erlang.org/doc/man/gen_event.html

Robert
 
----- "shk" <kuleshovmail@REDACTED> wrote:

> Thank you for reply. 
> 
> I make it first:
> 
> handle_event({test}, State) ->
>     io:format("Test"),
>     {ok, State};
> handle_event(_Event, _State) ->
>     {ok, _State}.
> 
> But when i call notify/1 it's nothing output.
> -- 
> View this message in context:
> http://erlang.2086793.n4.nabble.com/gen-event-help-tp3242753p3243763.html
> Sent from the Erlang Questions mailing list archive at Nabble.com.
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED

-- 
Robert Virding, Erlang Solutions Ltd.


More information about the erlang-questions mailing list