Current section

Files

Jump to
flub lib flub dispatcher_sup.ex
Raw

lib/flub/dispatcher_sup.ex

defmodule Flub.DispatcherSup do
use Supervisor
#############
# API
#############
def start_link do
Supervisor.start_link(__MODULE__, [], [name: __MODULE__])
end
def start_worker(channel) do
Supervisor.start_child(__MODULE__, [channel])
end
##############################
# GenServer Callbacks
##############################
def init([]) do
children = [
worker(Flub.Dispatcher, [], restart: :transient)
]
supervise(children, strategy: :simple_one_for_one)
end
##############################
# Internal
##############################
end