aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-03-01 14:44:39 -0500
committerBrian Cully <bjc@kublai.com>2008-03-01 14:44:39 -0500
commit9d698172ae5b68953ed899a0743e65f601cd37c7 (patch)
tree468ea0455fe5f8a33430d8e668cd1051649baf3e
parentd365c3a2be018d93125163974547623cde2b4675 (diff)
downloadmysqlerl-9d698172ae5b68953ed899a0743e65f601cd37c7.tar.gz
mysqlerl-9d698172ae5b68953ed899a0743e65f601cd37c7.zip
Prettify the supervision tree w/ names. Break modules out by registered names.
-rw-r--r--src/mysqlerl_app.erl14
-rw-r--r--src/mysqlerl_sup.erl17
2 files changed, 20 insertions, 11 deletions
diff --git a/src/mysqlerl_app.erl b/src/mysqlerl_app.erl
index 0517d3b..645d799 100644
--- a/src/mysqlerl_app.erl
+++ b/src/mysqlerl_app.erl
@@ -2,20 +2,12 @@
-author('bjc@kublai.com').
-behavior(application).
--behavior(supervisor).
--export([start/2, stop/1, init/1]).
+-export([start/2, stop/1]).
start(normal, []) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+ register(?MODULE, self()),
+ mysqlerl_sup:start_link().
stop([]) ->
ok.
-
-init([]) ->
- ConnectionSup = {mysqlerl_connection_sup,
- {mysqlerl_connection_sup, start_link, []},
- permanent, infinity, supervisor,
- [mysqlerl_connection_sup]},
- {ok, {{one_for_one, 10, 5},
- [ConnectionSup]}}.
diff --git a/src/mysqlerl_sup.erl b/src/mysqlerl_sup.erl
new file mode 100644
index 0000000..e8c1485
--- /dev/null
+++ b/src/mysqlerl_sup.erl
@@ -0,0 +1,17 @@
+-module(mysqlerl_sup).
+-author('bjc@kublai.com').
+
+-behavior(supervisor).
+
+-export([start_link/0, init/1]).
+
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+init([]) ->
+ ConnectionSup = {mysqlerl_connection_sup,
+ {mysqlerl_connection_sup, start_link, []},
+ permanent, infinity, supervisor,
+ [mysqlerl_connection_sup]},
+ {ok, {{one_for_one, 10, 5},
+ [ConnectionSup]}}.