Current section
Files
Jump to
Current section
Files
lib/kaguya/core_supervisor.ex
defmodule Kaguya.CoreSupervisor do
use Supervisor
require Logger
@moduledoc """
The supervisor of the Core of Kaguya. It mainly exists to be proc'd by Core
on :tcp_closed so that the Core can restart itself.
"""
def start_link(opts \\ []) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
def init(:ok) do
children = [
worker(Kaguya.Core, [])
]
Logger.log :debug, "Starting Core!"
supervise(children, strategy: :one_for_one)
end
end