diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-02 16:50:55 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-02 16:50:55 +0100 |
| commit | fd494df8dd598c0b61055c2a951a510681e7e232 (patch) | |
| tree | f3afc2e429d423268ee71b9e6e7c3ced1b122ba9 | |
| parent | d4a3c5a502910ebb7a6e79ad573de4762e75fa70 (diff) | |
| download | rabbitmq-server-git-fd494df8dd598c0b61055c2a951a510681e7e232.tar.gz | |
Added callback info to mirrored_supervisor.
| -rw-r--r-- | src/mirrored_supervisor.erl | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl index 9c814bd7ff..221f6a8727 100644 --- a/src/mirrored_supervisor.erl +++ b/src/mirrored_supervisor.erl @@ -120,8 +120,6 @@ delete_child/2, terminate_child/2, which_children/1, count_children/1, check_childspecs/1]). --export([behaviour_info/1]). - -behaviour(?GEN_SERVER). -behaviour(?SUPERVISOR). @@ -142,6 +140,21 @@ -ifdef(use_specs). +%%-------------------------------------------------------------------------- +%% Callback behaviour +%%-------------------------------------------------------------------------- + +-callback init(Args :: term()) -> + {ok, {{RestartStrategy :: supervisor2:strategy(), + MaxR :: non_neg_integer(), + MaxT :: non_neg_integer()}, + [ChildSpec :: supervisor2:child_spec()]}} + | ignore. + +%%-------------------------------------------------------------------------- +%% Specs +%%-------------------------------------------------------------------------- + -type startlink_err() :: {'already_started', pid()} | 'shutdown' | term(). -type startlink_ret() :: {'ok', pid()} | 'ignore' | {'error', startlink_err()}. @@ -166,6 +179,13 @@ -spec create_tables() -> Result when Result :: 'ok'. +-else. + +-export([behaviour_info/1]). + +behaviour_info(callbacks) -> [{init,1}]; +behaviour_info(_Other) -> undefined. + -endif. %%---------------------------------------------------------------------------- @@ -205,9 +225,6 @@ which_children(Sup) -> fold(which_children, Sup, fun lists:append/2). count_children(Sup) -> fold(count_children, Sup, fun add_proplists/2). check_childspecs(Specs) -> ?SUPERVISOR:check_childspecs(Specs). -behaviour_info(callbacks) -> [{init,1}]; -behaviour_info(_Other) -> undefined. - call(Sup, Msg) -> ?GEN_SERVER:call(child(Sup, mirroring), Msg, infinity). |
