Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Export stop function for stopping the pool

  • Loading branch information...
commit ce1cec4d57c19c81968b6f01173a1c9a2285257a 1 parent e89a71b
@Vagabond Vagabond authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/poolboy.erl
View
5 src/poolboy.erl
@@ -3,7 +3,7 @@
-module(poolboy).
-behaviour(gen_fsm).
--export([start_link/1, checkout/1, checkout/2, checkout/3, checkin/2]).
+-export([start_link/1, checkout/1, checkout/2, checkout/3, checkin/2, stop/1]).
-export([init/1, ready/2, ready/3, overflow/2, overflow/3, full/2, full/3,
handle_event/3, handle_sync_event/4, handle_info/3, terminate/3,
code_change/4]).
@@ -49,6 +49,9 @@ start_link(Args) ->
gen_fsm:start_link(Name, ?MODULE, Args, [])
end.
+stop(Pool) ->
+ gen_fsm:sync_send_all_state_event(Pool, stop).
+
init(Args) ->
process_flag(trap_exit, true),
init(Args, #state{}).
Please sign in to comment.
Something went wrong with that request. Please try again.