Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from rabbitmq/rabbitmq-web-mqtt-7
Browse files Browse the repository at this point in the history
Cleanup ranch listener on application stop
  • Loading branch information
dumbbell committed May 9, 2016
2 parents bda7193 + c49d8b6 commit 0d07634
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rabbit_web_mqtt_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-module(rabbit_web_mqtt_app).

-behaviour(application).
-export([start/2, stop/1]).
-export([start/2, prep_stop/1, stop/1]).

%% Dummy supervisor - see Ulf Wiger's comment at
%% http://erlang.2086793.n4.nabble.com/initializing-library-applications-without-processes-td2094473.html
Expand All @@ -31,6 +31,11 @@ start(_Type, _StartArgs) ->
mqtt_init(),
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

-spec prep_stop(term()) -> term().
prep_stop(State) ->
ranch:stop_listener(web_mqtt),
State.

-spec stop(_) -> ok.
stop(_State) ->
ok.
Expand Down

0 comments on commit 0d07634

Please sign in to comment.