[ejabberd] understanding module development

Badlop badlop at gmail.com
Tue Apr 14 23:04:50 MSD 2009


2009/4/14 mark peleus <mark.peleus at gmail.com>:
> I'm trying to modify mod_rest.
> I don't understand why mod_rest needs to define the supervisor:

> In addition, ejabberd wiki about http request handlers doesn't mention
> supervisors
> http://www.process-one.net/en/wiki/ejabberd_HTTP_request_handlers/
> Is mod_rest a specific case that requires to define the supervisor?

Looking at its source code, mod_rest doesn't use that supervisor in any way.

Maybe the module author started writing mod_rest as a fork of another
module that had that code, and later didn't notice the supervisor is
not used. Or maybe he added the supervisor because he planed to
develop some feature that would use it. You can contact the original
author.

For reference, the initial module was announced here:
http://nolan.eakins.net/node/310

The module works correctly (the stanzas are delivered) after I remove
that code and keep only:

start(_Host, _Opts) ->
    ?DEBUG("Starting: ~p ~p", [_Host, _Opts]),
    ok.

stop(_Host) ->
    ok.


I'll remove that code in the SVN.


---
Badlop
ProcessOne


More information about the ejabberd mailing list