Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  register existing process as event handler

Guest
Posted: Wed Sep 07, 2011 8:27 am Reply with quote
Guest
Hello

I have one beginner-question regarding gen_event:

Is it possible to register an existing process as an event handler to
an event manager (or to multiple event managers)?

Thanks

Best,

Zsolt
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Post received from mailinglist
Guest
Posted: Wed Sep 07, 2011 9:12 am Reply with quote
Guest
Event managers/handlers are different to gen servers/fsms. With a server/fsm each one is a separate process with one callback module which is either a gen_server or a gen_fsm behaviour.

With event managers/handlers only the event manager is a separate process. Event handlers are just callback modules which you register with event managers. You can register many event handlers with each manager and register a handler with many managers. When an event manager receives an event it calls a callback function in each event handler module which has been registered with it. The callback functions are evaluated directly in the event manager process, so event handlers as such are not separate processes.

Of course an event handler module can send messages for the events it processes, this is the common case, but such processes are not really the actual event handlers.

Robert

----- Original Message -----
> Hello
>
> I have one beginner-question regarding gen_event:
>
> Is it possible to register an existing process as an event handler to
> an event manager (or to multiple event managers)?
>
> Thanks
>
> Best,
>
> Zsolt
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum