diff options
| author | Nathan Perry <np@nathanperry.dev> | 2024-08-08 14:53:04 -0400 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2024-08-08 14:53:04 -0400 |
| commit | 0659c3be4e996ca97a1a9d02142f2809507d2b38 (patch) | |
| tree | a80381a8092cdb4587c0623921f355308408ede5 /lib/audio/supervisor.ex | |
| parent | 7ccdb63fb7f4008b7d785c687b4f55b6b4291483 (diff) | |
voice playback workselixir
Diffstat (limited to 'lib/audio/supervisor.ex')
| -rw-r--r-- | lib/audio/supervisor.ex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/audio/supervisor.ex b/lib/audio/supervisor.ex index 0b86a1c..290dd95 100644 --- a/lib/audio/supervisor.ex +++ b/lib/audio/supervisor.ex @@ -1,2 +1,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 |
