tags:

views:

177

answers:

2

Question is why some applications (like ejabberd) use own hooks module (e.g. ejabberd_hooks.erl) instead of gen_event?

+3  A: 

Don't expect the answer to be too interesting. Either it was because the author wasnt familiar with gen_event, or it didnt perform well enough back in 2004 when ejabberd_hooks was added.

Christian
I would tend to agree with Christian.
jldupont
+1, if your question is geared toward which should you use? then go with gen_event until it no longer meets your needs.
Jeremy Wall
+10  A: 

Ejabberd hooks and gen_event are quite different things. Ejabberd hooks are evaluated by the process calling them - gen_event handlers run in one single gen_event process. As Ejabberd needs to run many hooks for most messages, sending each xmpp message to lots of different gen_event processes wouldn't get as high message throughput as the Ejabberd approach does.

archaelus