aboutsummaryrefslogtreecommitdiff
path: root/lib/octonetcat/supervisor.ex
blob: 50a5f668ddb4a7ff7be0f93440bef7ef791a4717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
defmodule Octonetcat.Supervisor do
  @moduledoc """
  Root Octonetcat Supervosor
  """

  use Supervisor

  def start_link do
    Supervisor.start_link(__MODULE__, [], name: __MODULE__)
  end

  def init(_) do
    children = [
      supervisor(Task.Supervisor, [[name: Octonetcat.TaskSupervisor]]),
      worker(Task, [Octonetcat.Accepter, :accept, []])
    ]

    opts = [strategy: :one_for_one]
    supervise(children, opts)
  end
end