[erlang-questions] MyModule:start_link/? vs supervisor:start_link/3

Charles Shuller charles.shuller@REDACTED
Tue Sep 13 23:06:26 CEST 2016


Hello,

I've developed a marked preference for starting the primary supervisor in
my application callback modules as:

    supervisor:start_link({local, my_module}, my_module, InitArgs)

But I've noticed that most code I see seems to prefer:

    my_module:start_link(InitArgs)

where my_module:start_link always calls supervisor:start_link call.


Is there any advantage to specifying a custom start_link in the supervisor
callback module??   It seems to me that the "owner" of the supervisor is
the application, and therefore the configuration (i.e. parameter values)
should be performed by the application callback, and not the supervisor
callback.


Thanks!

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160913/9de263b8/attachment.htm>


More information about the erlang-questions mailing list