Skip to content

Commit

Permalink
Merge remote branch 'cloudant:remove-unused-config-subscriber'
Browse files Browse the repository at this point in the history
This closes #5

Signed-off-by: Eric Avdey <[email protected]>
  • Loading branch information
eiri committed Oct 4, 2016
2 parents ba99ec7 + 5f5375a commit 1d2b149
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/ioq_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
-module(ioq_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
-export([handle_config_change/5, handle_config_terminate/3]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
Expand All @@ -22,24 +21,4 @@ start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) ->
{ok, { {one_for_one, 5, 10}, [
{
config_listener_mon,
{config_listener_mon, start_link, [?MODULE, nil]},
permanent,
5000,
worker,
[config_listener_mon]
},
?CHILD(ioq, worker)
]} }.

handle_config_change("ioq", _Key, _Val, _Persist, St) ->
gen_server:cast(ioq_server, update_config),
{ok, St};
handle_config_change(_Sec, _Key, _Val, _Persist, St) ->
{ok, St}.

handle_config_terminate(_Server, _Reason, _State) ->
gen_server:cast(ioq_server, update_config),
ok.
{ok, { {one_for_one, 5, 10}, [?CHILD(ioq, worker)]}}.

0 comments on commit 1d2b149

Please sign in to comment.