Current section

Files

Jump to
tai lib tai venues supervisor.ex
Raw

lib/tai/venues/supervisor.ex

defmodule Tai.Venues.Supervisor do
use DynamicSupervisor
def start_link(_) do
DynamicSupervisor.start_link(__MODULE__, :ok, name: __MODULE__)
end
def start(venue) do
DynamicSupervisor.start_child(__MODULE__, {Tai.Venues.Start, venue})
end
def stop(pid) when is_pid(pid) do
DynamicSupervisor.terminate_child(__MODULE__, pid)
end
def init(_) do
DynamicSupervisor.init(strategy: :one_for_one)
end
end