summaryrefslogtreecommitdiff
path: root/src/mirrored_supervisor.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mirrored_supervisor.erl')
-rw-r--r--src/mirrored_supervisor.erl27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl
index 9c814bd7..221f6a87 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).