summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-08-09 13:38:27 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-08-09 13:38:27 +0100
commit4754d837626559b51120596c2bcb86398b731a82 (patch)
tree20be695d426138e8401ba5428d86a933b3d8dad7
parent81358ff87e760e4d06942682ee729c278ddb9327 (diff)
downloadrabbitmq-server-git-4754d837626559b51120596c2bcb86398b731a82.tar.gz
Convert rabbit_sup to supervisor2 using intrinsic
-rw-r--r--src/rabbit_sup.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rabbit_sup.erl b/src/rabbit_sup.erl
index 97613d17a5..bf29d5426e 100644
--- a/src/rabbit_sup.erl
+++ b/src/rabbit_sup.erl
@@ -31,7 +31,7 @@
-module(rabbit_sup).
--behaviour(supervisor).
+-behaviour(supervisor2).
-export([start_link/0, start_child/1, start_child/2, start_child/3,
start_restartable_child/1, start_restartable_child/2, stop_child/1]).
@@ -43,7 +43,7 @@
-define(SERVER, ?MODULE).
start_link() ->
- supervisor:start_link({local, ?SERVER}, ?MODULE, []).
+ supervisor2:start_link({local, ?SERVER}, ?MODULE, []).
start_child(Mod) ->
start_child(Mod, []).
@@ -52,9 +52,9 @@ start_child(Mod, Args) ->
start_child(Mod, Mod, Args).
start_child(ChildId, Mod, Args) ->
- {ok, _} = supervisor:start_child(?SERVER,
- {ChildId, {Mod, start_link, Args},
- transient, ?MAX_WAIT, worker, [Mod]}),
+ {ok, _} = supervisor2:start_child(?SERVER,
+ {ChildId, {Mod, start_link, Args},
+ intrinsic, ?MAX_WAIT, worker, [Mod]}),
ok.
start_restartable_child(Mod) ->
@@ -62,16 +62,16 @@ start_restartable_child(Mod) ->
start_restartable_child(Mod, Args) ->
Name = list_to_atom(atom_to_list(Mod) ++ "_sup"),
- {ok, _} = supervisor:start_child(
+ {ok, _} = supervisor2:start_child(
?SERVER,
{Name, {rabbit_restartable_sup, start_link,
[Name, {Mod, start_link, Args}]},
- transient, infinity, supervisor, [rabbit_restartable_sup]}),
+ intrinsic, infinity, supervisor, [rabbit_restartable_sup]}),
ok.
stop_child(ChildId) ->
- case supervisor:terminate_child(?SERVER, ChildId) of
- ok -> supervisor:delete_child(?SERVER, ChildId);
+ case supervisor2:terminate_child(?SERVER, ChildId) of
+ ok -> supervisor2:delete_child(?SERVER, ChildId);
E -> E
end.