aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/mysqlerl_connection_sup.erl
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-06 20:15:48 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2012-02-06 20:15:48 -0500
commit10b824963ff7b0b012e6b85c8b3f07904c473fd1 (patch)
tree344e00f788ea24c273f841636bdf92f354b40e2c /lib/src/mysqlerl_connection_sup.erl
parent591169f86718117151bf9eb5960ba58e2a27a5bb (diff)
downloadmysqlerl-10b824963ff7b0b012e6b85c8b3f07904c473fd1.tar.gz
mysqlerl-10b824963ff7b0b012e6b85c8b3f07904c473fd1.zip
Remove stupid lib directory
Diffstat (limited to 'lib/src/mysqlerl_connection_sup.erl')
-rw-r--r--lib/src/mysqlerl_connection_sup.erl31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/src/mysqlerl_connection_sup.erl b/lib/src/mysqlerl_connection_sup.erl
deleted file mode 100644
index 6e1632a..0000000
--- a/lib/src/mysqlerl_connection_sup.erl
+++ /dev/null
@@ -1,31 +0,0 @@
--module(mysqlerl_connection_sup).
--author('bjc@kublai.com').
-
--behavior(supervisor).
-
--export([random_child/0]).
--export([start_link/0, connect/6]).
-
--export([init/1]).
-
-start_link() ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, []).
-
-connect(Host, Port, Database, User, Password, Options) ->
- supervisor:start_child(?MODULE, [self(), Host, Port, Database,
- User, Password, Options]).
-
-random_child() ->
- case get_pids() of
- [] -> {error, no_connections};
- Pids -> lists:nth(erlang:phash(now(), length(Pids)), Pids)
- end.
-
-init([]) ->
- Connection = {undefined, {mysqlerl_connection, start_link, []},
- transient, 5, worker, [mysqlerl_connection]},
- {ok, {{simple_one_for_one, 10, 5},
- [Connection]}}.
-
-get_pids() ->
- [Pid || {_Id, Pid, _Type, _Modules} <- supervisor:which_children(?MODULE)].