[ejabberd] why is mod_offline.handle_info implemented?
monkeyfdude at gmail.com
Sun Mar 1 20:47:54 MSK 2015
Thanks for clarification.
You note in the end "*Whether or not it would be a good idea depends on
your module*" has got me worried/scared but I think I will crash and learn.
On Sun, Mar 1, 2015 at 9:16 AM, Holger Weiß <holger at zedat.fu-berlin.de>
> * Gaurav Jain <monkeyfdude at gmail.com> [2015-03-01 08:29]:
> > My confusion is/was:
> > * Under which circumstances the* gen_server:callback:handle_info* will be
> > triggered (*Use case*)
> It is used internally by mod_offline to pass an offline message to the
> process which stores that message:
> Instead of passing the message using the "!" operator and receiving it
> with handle_info/2, mod_offline could use gen_server:cast/2 to send and
> handle_cast/2 to receive it. The effect would be mostly the same.
> > I wrote a custom module based on (*offlline_message_hook*)
> > https://www.process-one.net/en/wiki/ejabberd_events_and_hooks/
> > which does *NOT* require us to implement *gen_server*:*handle_info*
> Indeed, the ejabberd API doesn't require you to implement a gen_server
> at all. Whether or not it would be a good idea depends on your module.
> ejabberd mailing list
> ejabberd at jabber.ru
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ejabberd