summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-29 14:10:01 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-10-29 14:10:01 +0100
commitee50579684da36f33d30408f804ec96188fb56c0 (patch)
treeb43b437d6ccfcdbf25d0157d6efa6d6975bece0e
parentfc86381ccac10fa30aefe76996a716ae1d677f5b (diff)
Add rebar app skeleton
-rw-r--r--src/pbx.app.src12
-rw-r--r--src/pbx_app.erl16
-rw-r--r--src/pbx_sup.erl27
3 files changed, 55 insertions, 0 deletions
diff --git a/src/pbx.app.src b/src/pbx.app.src
new file mode 100644
index 0000000..313a7c3
--- /dev/null
+++ b/src/pbx.app.src
@@ -0,0 +1,12 @@
+{application, pbx,
+ [
+ {description, ""},
+ {vsn, "1"},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]},
+ {mod, { pbx_app, []}},
+ {env, []}
+ ]}.
diff --git a/src/pbx_app.erl b/src/pbx_app.erl
new file mode 100644
index 0000000..5750323
--- /dev/null
+++ b/src/pbx_app.erl
@@ -0,0 +1,16 @@
+-module(pbx_app).
+
+-behaviour(application).
+
+%% Application callbacks
+-export([start/2, stop/1]).
+
+%% ===================================================================
+%% Application callbacks
+%% ===================================================================
+
+start(_StartType, _StartArgs) ->
+ pbx_sup:start_link().
+
+stop(_State) ->
+ ok.
diff --git a/src/pbx_sup.erl b/src/pbx_sup.erl
new file mode 100644
index 0000000..a28b5c0
--- /dev/null
+++ b/src/pbx_sup.erl
@@ -0,0 +1,27 @@
+-module(pbx_sup).
+
+-behaviour(supervisor).
+
+%% API
+-export([start_link/0]).
+
+%% Supervisor callbacks
+-export([init/1]).
+
+%% Helper macro for declaring children of supervisor
+-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
+
+%% ===================================================================
+%% API functions
+%% ===================================================================
+
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+%% ===================================================================
+%% Supervisor callbacks
+%% ===================================================================
+
+init([]) ->
+ {ok, { {one_for_one, 5, 10}, []} }.
+