how does it work

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how does it work

Dietmar Schaefer-2

I found this supervisor code:

                                                                                                                                                                                                                                                                                                        
-define(SERVER,?MODULE).                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
start_link()->                                                                                                                                                                                                                                                                                              supervisor:start_link({local,?SERVER},?MODULE,[]).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   


init([])->                    

    {ok, {{one_for_all, 0, 1},[]}}.

How can it work without any specification about what to start?


regards

Dietmar


Reply | Threaded
Open this post in threaded view
|

Re: how does it work

Dmytro Lytovchenko
It starts nothing just empty supervisor.
You can add more by using `supervisor:start_child(SupName, Spec)`

On Fri, 17 Jan 2020 at 13:50, Dietmar Schaefer <[hidden email]> wrote:

I found this supervisor code:

                                                                                                                                                                                                                                                                                                        
-define(SERVER,?MODULE).                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
start_link()->                                                                                                                                                                                                                                                                                              supervisor:start_link({local,?SERVER},?MODULE,[]).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   


init([])->                    

    {ok, {{one_for_all, 0, 1},[]}}.

How can it work without any specification about what to start?


regards

Dietmar