Implement deltas server, replacing beam_stats_state.
[beam_stats.git] / src / beam_stats_sup.erl
index 7cfec55..d582df4 100644 (file)
@@ -3,30 +3,30 @@
 -behaviour(supervisor).
 
 %% API
--export([start_link/0]).
+-export([start_link/1]).
 
 %% Supervisor callbacks
 -export([init/1]).
 
 %% Helper macro for declaring children of supervisor
--define(CHILD(Type, Module),
-    {Module, {Module, start_link, []}, permanent, 5000, Type, [Module]}).
+-define(CHILD(Type, Module, Args),
+    {Module, {Module, start_link, Args}, permanent, 5000, Type, [Module]}).
 
 %% ===================================================================
 %% API functions
 %% ===================================================================
 
-start_link() ->
-    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+start_link(DeltasServer) ->
+    supervisor:start_link({local, ?MODULE}, ?MODULE, DeltasServer).
 
 %% ===================================================================
 %% Supervisor callbacks
 %% ===================================================================
 
-init([]) ->
+init(DeltasServer) ->
     Children =
-        [ ?CHILD(worker     , beam_stats_producer)
-        , ?CHILD(supervisor , beam_stats_sup_consumers)
-        ],
+    [ ?CHILD(worker     , beam_stats_producer     , [DeltasServer])
+    , ?CHILD(supervisor , beam_stats_sup_consumers, [])
+    ],
     SupFlags = {one_for_one, 5, 10},
     {ok, {SupFlags, Children}}.
This page took 0.018543 seconds and 4 git commands to generate.