Skip to content

Commit

Permalink
Handle {gen_event_EXIT,{config_listener,ioq},shutdown} message
Browse files Browse the repository at this point in the history
  • Loading branch information
kxepal committed Jan 13, 2015
1 parent c552c66 commit 2175035
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ioq.erl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ handle_info({Ref, Reply}, State) ->
false ->
{noreply, State, 0}
end;

handle_info({'DOWN', Ref, _, _, Reason}, State) ->
case lists:keytake(Ref, #request.ref, State#state.running) of
{value, Request, Remaining} ->
Expand All @@ -84,7 +83,12 @@ handle_info({'DOWN', Ref, _, _, Reason}, State) ->
false ->
{noreply, State, 0}
end;

handle_info({gen_event_EXIT, {config_listener, ?MODULE}, _Reason}, State) ->
erlang:send_after(5000, self(), restart_config_listener),
{noreply, State};
handle_info(restart_config_listener, State) ->
ok = config:listen_for_changes(?MODULE, nil),
{noreply, State};
handle_info(timeout, State) ->
{noreply, maybe_submit_request(State)}.

Expand Down

0 comments on commit 2175035

Please sign in to comment.