[ejabberd] Communicate with other modules
michael.weibel+xmpp at gmail.com
Mon Jan 30 13:23:41 MSK 2012
I managed to get it working by registering the shared resource as a
globally registered gen_server.
But I'll take a look on the gen_fsm which I don't know yet (as I'm still
Am 30.01.2012 um 10:11 schrieb Stefan Strigler:
> I'm not sure whether gen_server is the right choice here. Typically your
scenario is what's called keeping guard of a shared resource (the link to
the DB). You'd naively implement this by spawning a process which waits for
messages of the other modules to fulfill queries on their behalf and
synchronously or asynchronously send back replies to those other "modules"
(which are running processes itself in fact). This whole thing can be
formalized by using the gen_fsm pattern which is the general approach
ejabberd uses for all of its architecture. By using a supervisor for this
FSM you can make sure to keep such a process up and running in case of
failures (which would otherwise be fatal to the overall system).
> Greets, Steve
> ejabberd mailing list
> ejabberd at jabber.ru
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ejabberd