aboutsummaryrefslogtreecommitdiff
path: root/lib/octochat/supervisor.ex
blob: d551628d40711d79bb434f830f4829f223069e3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
defmodule Octochat.Supervisor do
  @moduledoc """
  Octochat OTP Supervisor tree
  """

  use Supervisor

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

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

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

end