aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkballou <kballou@devnulllabs.io>2016-10-30 22:25:56 -0600
committerkballou <kballou@devnulllabs.io>2016-10-30 23:07:59 -0600
commit10275f7bbf7c79214a52e837294a8c16fdfaa549 (patch)
treebd28550932fa394005185f7d2ed76e9d12cf3169
parentf05b46fdc9092bd8dabb85257f0746312aad0bfe (diff)
downloadoctochat-10275f7bbf7c79214a52e837294a8c16fdfaa549.tar.gz
octochat-10275f7bbf7c79214a52e837294a8c16fdfaa549.tar.xz
Add OTP app and sup modules
-rw-r--r--lib/octochat/application.ex12
-rw-r--r--lib/octochat/supervisor.ex19
-rw-r--r--mix.exs3
3 files changed, 33 insertions, 1 deletions
diff --git a/lib/octochat/application.ex b/lib/octochat/application.ex
new file mode 100644
index 0000000..a820dcc
--- /dev/null
+++ b/lib/octochat/application.ex
@@ -0,0 +1,12 @@
+defmodule Octochat.Application do
+ @moduledoc """
+ Octochat OTP application/entry point
+ """
+
+ use Application
+
+ def start(_, _) do
+ Octochat.Supervisor.start_link()
+ end
+
+end
diff --git a/lib/octochat/supervisor.ex b/lib/octochat/supervisor.ex
new file mode 100644
index 0000000..b26f4de
--- /dev/null
+++ b/lib/octochat/supervisor.ex
@@ -0,0 +1,19 @@
+defmodule Octochat.Supervisor do
+ @moduledoc """
+ Octochat OTP Supervisor tree
+ """
+
+ 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 1605814..cb7b454 100644
--- a/mix.exs
+++ b/mix.exs
@@ -14,7 +14,8 @@ defmodule Octochat.Mixfile do
end
def application do
- [applications: [:logger]]
+ [applications: [:logger],
+ mod: {Octochat.Application, []}]
end
defp deps do