Packages
SuperWorker is a powerful Elixir library for working with supervisors and background jobs. It provides a much simpler approach than traditional supervisors. This library is currently under development and is unstable, so it is not recommended for production use.
Current section
Files
Jump to
Current section
Files
lib/application.ex
defmodule SuperWorker.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
require Logger
alias SuperWorker.ConfigLoader.ConfigParser, as: Cfg
@impl true
@spec start(any, any) :: {:error, any} | {:ok, pid}
def start(_type, _args) do
Logger.debug("SuperWorker, Application, start app")
# Load supervisors' configuration
Cfg.load()
children = []
Logger.debug("SuperWorker, Application, load with children: #{inspect(children)}")
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: SuperWorker.MainAppSupervisor]
Supervisor.start_link(children, opts)
end
end