aboutsummaryrefslogtreecommitdiff
path: root/lib/audio/supervisor.ex
blob: 290dd95e063cf4e8d2a060eed51f29918c84c6d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
defmodule Thulani.Audio.Supervisor do
  use DynamicSupervisor
  alias Thulani.Audio

  def start_link(arg) do
    DynamicSupervisor.start_link(__MODULE__, arg, name: __MODULE__)
  end

  def start_child(guild_id) do
    DynamicSupervisor.start_child(__MODULE__, {Audio.Server, guild_id})
  end

  @impl true
  def init(_arg) do
    DynamicSupervisor.init(strategy: :one_for_one)
  end
end