From 263ec967e18a0dbb874f2297cbeb7b3ef042cd9a Mon Sep 17 00:00:00 2001 From: kballou Date: Thu, 16 Nov 2017 22:41:26 -0700 Subject: Add initial OTP app and supervisor --- lib/octonetcat/application.ex | 12 ++++++++++++ lib/octonetcat/supervisor.ex | 18 ++++++++++++++++++ mix.exs | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lib/octonetcat/application.ex create mode 100644 lib/octonetcat/supervisor.ex diff --git a/lib/octonetcat/application.ex b/lib/octonetcat/application.ex new file mode 100644 index 0000000..2c377f4 --- /dev/null +++ b/lib/octonetcat/application.ex @@ -0,0 +1,12 @@ +defmodule Octonetcat.Application do + @moduledoc """ + Octonetcat Application entry + """ + + use Application + + def start(_, _) do + Octonetcat.Supervisor.start_link() + end + +end diff --git a/lib/octonetcat/supervisor.ex b/lib/octonetcat/supervisor.ex new file mode 100644 index 0000000..e66b4e7 --- /dev/null +++ b/lib/octonetcat/supervisor.ex @@ -0,0 +1,18 @@ +defmodule Octonetcat.Supervisor do + @moduledoc """ + Root Octonetcat Supervosor + """ + + use Supervisor + + def start_link do + Supervisor.start_link(__MODULE__, [], name: __MODULE__) + end + + def init(_) do + children = [] + + opts = [strategy: :one_for_one] + supervise(children, opts) + end +end diff --git a/mix.exs b/mix.exs index 39f1374..d21b0a7 100644 --- a/mix.exs +++ b/mix.exs @@ -17,7 +17,8 @@ defmodule Octonetcat.Mixfile do # Run "mix help compile.app" to learn about applications. def application do [ - extra_applications: [:logger] + extra_applications: [:logger], + mod: {Octonetcat.Application, []} ] end -- cgit v1.2.1