[erlang-questions] pub-sub server implementation detail question.
Dmitry Kolesnikov
dmkolesnikov@REDACTED
Tue Mar 5 21:26:04 CET 2013
Hello,
Here is copy-past from documentation.
-- CLIP --
A gen_event manager is the process that registers callbacks. It is very important to understand that all events dispatched by the event manager process to event handlers execute in the context of the event manager process.
-- CLIP --
If you implement PubSub via gen_event then all you subscriber handlers are executed within dispatcher process. This is not good. you would end-up implementing an gen_event handler as a proxy to your subscriber. Why to bother if ten_server can be used directly.
- Dmitry
On Mar 5, 2013, at 9:11 PM, Huseyin Yilmaz <yilmazhuseyin@REDACTED> wrote:
> Hi
> I was checking the source code for kraken (https://github.com/Asana/kraken). I realized that this pub sub server was implemented by using gen_server behavior. But when I think about a pub-sub server, I would definitely choose to use gen_event behavior I think gen_event behavior solves this kind of problems very well. I was wondering if there is a reason for not using gen_event behavior for pub-sub server that I am not aware of?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130305/eafb4de0/attachment.htm>
More information about the erlang-questions
mailing list