[erlang-questions] ejabberd_listener supervisor

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Tue May 7 11:24:09 CEST 2013


In principle it should have a -behaviour declaration, yes. But in Erlang it is enough if the module exports the right functions so the supervisor module can make the correct callbacks. It is not checked. The reason for the -behaviour line is two-fold:

* It serves as documentation for the reader. The reader will know the general structure of the module given its behaviour.
* It provides the compiler an opportunity of warnings if the wrong functions are defined.

Jesper Louis Andersen
  Erlang Solutions Ltd., Copenhagen



On May 6, 2013, at 2:58 PM, Manoj Raj <rajmanoj.bottle@REDACTED> wrote:

> A supervisor module should have the following declaration...right?
> 
> -behaviour(supervisor).
> 
> But in ejabberd application, ejabberd_listener supervisor module don't have the behavior thing declared...And how it works right?...Is it because it is started by another supervisor module (ejabberd_sup) as a supervisor process?
> 
> Please someone clarify me...
> 
> Thank you 
> 
> Cheers,
> Mandoo
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list