Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dummy commit

  • Loading branch information...
commit 2ce75d6760d79b36ac500a00921f22da6b8ea675 1 parent 8407942
@pavlobaron authored
Showing with 0 additions and 53 deletions.
  1. +0 −16 src/lib/dr_env_lib.erl
  2. +0 −37 src/lib/dr_supervisor_lib.erl
View
16 src/lib/dr_env_lib.erl
@@ -1,16 +0,0 @@
-%% @author Pavlo Baron <pb@pbit.org>
-%% @copyright 2010 Pavlo Baron
-
--module(env_lib).
-
--export([get_env/2]).
-
-get_env(Area) ->
- Ret = application:get_env(devroulette, Area),
- case Ret of
- {ok, L} -> L;
- _ -> []
- end.
-
-get_env(Area, Key) ->
- [H | _T] = [X || {T, X} <- get_env(Area), T == Key], H.
View
37 src/lib/dr_supervisor_lib.erl
@@ -1,37 +0,0 @@
-%% @author Pavlo Baron <pb@pbit.org>
-%% @copyright 2010 Pavlo Baron
-
--module(supervisor_lib).
-
--export([start_dynamic_child/8, make_child_id/2, kill_dynamic_child/2]).
-
-new_child_spec(Id, M, F, A, Restart, Time, Type) ->
- {Id, {M, F, A}, Restart, Time, Type, [M]}.
-
-make_child_id(Id, Atom) ->
- list_to_atom(string:concat(string:concat(atom_to_list(Id), "_"), atom_to_list(Atom))).
-
-start_dynamic_child(Id, M, F, A, Restart, Time, Type, ChildId) ->
- Spec = new_child_spec(ChildId, M, F, A, Restart, Time, Type),
- Result = supervisor:start_child(Id, Spec),
- error_logger:info_report("supervisor:start_child returned: "),
- error_logger:info_report(Result),
- case Result of
- {ok, _} -> {ok, Id};
- {ok, _, _} -> {ok, Id};
- {error, _} -> {error, Id}
- end.
-
-kill_dynamic_child(Id, ChildId) ->
- error_logger:info_report("trying to terminate child: "),
- error_logger:info_report(ChildId),
- Terminate = supervisor:terminate_child(Id, ChildId),
-
- %%FIXME: terminate doesn't return immidiately -> fix it to loop
- %%and to wait for the child process to be killed
-
- error_logger:info_report("child termination returned: "),
- error_logger:info_report(Terminate),
- Delete = supervisor:delete_child(Id, ChildId),
- error_logger:info_report("spec delete returned: "),
- error_logger:info_report(Delete).
Please sign in to comment.
Something went wrong with that request. Please try again.