defmodule Runbox.Application do @moduledoc false use Application @impl true def start(type, args) do case Application.fetch_env!(:runbox, :mode) do :master -> start_master(type, args) :slave -> start_slave(type, args) end end defp start_master(_type, _args) do children = [] opts = [strategy: :one_for_one, name: Runbox.MasterSup] Supervisor.start_link(children, opts) end defp start_slave(_type, _args) do children = [{Toolbox.Scenario.Helper, []}] opts = [strategy: :one_for_one, name: Runbox.SlaveSup] Supervisor.start_link(children, opts) end end