performance_supervisor.ex 475 Bytes
Newer Older
Jens-Christian Fischer's avatar
Jens-Christian Fischer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
defmodule Grengine.PerformanceSupervisor do
  use Supervisor

  require Logger

  def start_link do

    Logger.info "Starting PerformanceSupervisor"
    Supervisor.start_link(__MODULE__, [], name: :performance_supervisor)
  end

  def start_performance(name) do
    Supervisor.start_child(:performance_supervisor, [name])
  end

  def init(_) do
    children = [
      worker(Grengine.Performance, [])
    ]

    supervise(children, strategy: :simple_one_for_one)
  end
end