blogit v1.2.3 Blogit.Supervisor View Source
This module represents the root Supervisor of Blogit.
It uses a one_for_all strategy to supervise its children.
The children are:
Blogit.Serverworker used as the core process ofBlogit. If it fails all the top-level processes of the application must be restarted, thus theone_for_allstrategy.Blogit.Components.Supervisorsupervisor which supervises the components of Blogit that can be queried. If this process fails it will be good to restart all the top-level processes, because theBlogit.Serverprocess is used by the components to manage their data.- A Task.Supervisor used to supervise all the Tasks in Blogit.
- If the Applications is using the
Blogit.RepositoryProviders.Memoryprovider, a worker representing the in-memory repository is started and supervised too.
Blogit.Supervisor is started in Blogit.start/2 using
Blogit.Supervisor.start_link/1 and the result of this call is what the
start function of the Blogit application returns.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for Supervisor.init/1.
Accepts a module implementing Blogit.RepositoryProvider and starts the
supervisor defined by this module.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Callback implementation for Supervisor.init/1.
start_link(repository_provider)
View Sourcestart_link(module()) :: Supervisor.on_start()
Accepts a module implementing Blogit.RepositoryProvider and starts the
supervisor defined by this module.
The Blogit.RepositoryProvider module is passed to the Supervisor.init/1
callback implemented by this module and is used to create and start the
Blogit.Server worker.
This function is called by Blogit.start/2 and its result is returned by it.