[ejabberd] Communicate with other modules

Michael Weibel michael.weibel+xmpp at gmail.com
Mon Jan 30 12:49:39 MSK 2012


Hi all,

I'm implementing multiple modules which should use the same connection to a
mongodb (I'm using the official mongodb-erlang driver).
To achieve this, I'd like to create a module which just opens the
connection to the db and other modules could call this generic module.

How can I do this?
In the generic module I create a gen_server which opens the db connection
and now I tried from the other modules to call it with
gen_server:cast(generic_module, {data})
But this doesn't work.

Do I need to create an application for that?

- Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20120130/297645f8/attachment.html>


More information about the ejabberd mailing list