farmbot_os/farmbot_core/lib/farmbot_core/asset/supervisor.ex

39 lines
907 B
Elixir
Raw Normal View History

defmodule Farmbot.Asset.Supervisor do
@moduledoc false
use Supervisor
2018-10-29 16:27:01 -06:00
alias Farmbot.{AssetSupervisor, AssetMonitor}
alias Farmbot.Asset.{
Repo,
Device,
2018-10-29 16:27:01 -06:00
FarmEvent,
FarmwareEnv,
FarmwareInstallation,
FbosConfig,
2018-10-29 16:27:01 -06:00
PinBinding,
Peripheral,
PersistentRegimen
2018-10-29 16:27:01 -06:00
}
def start_link(args) do
2018-10-29 16:27:01 -06:00
Supervisor.start_link(__MODULE__, args, name: __MODULE__)
end
def init([]) do
children = [
2018-10-29 16:27:01 -06:00
Repo,
{AssetSupervisor, module: FbosConfig},
{AssetSupervisor, module: Device},
{AssetSupervisor, module: PersistentRegimen},
2018-10-29 16:27:01 -06:00
{AssetSupervisor, module: FarmEvent},
{AssetSupervisor, module: PinBinding},
{AssetSupervisor, module: Peripheral},
{AssetSupervisor, module: FarmwareInstallation},
{AssetSupervisor, module: FarmwareEnv},
2018-10-29 16:27:01 -06:00
AssetMonitor
]
2018-10-29 16:27:01 -06:00
Supervisor.init(children, strategy: :one_for_one)
end
end