Skip to content

Instantly share code, notes, and snippets.

@aronisstav aronisstav/poolboy_tests_1.erl Secret
Last active Aug 29, 2015

Embed
What would you like to do?
%% Extracted and adapted for use with Concuerror from
%% https://github.com/devinus/poolboy/blob/1.2.1/test/poolboy_tests.erl
-module(poolboy_tests_1).
-export([pool_startup/0, pool_startup_no_stop/0]).
pool_startup() ->
{ok, Pid} = new_pool(1, 0),
ok = pool_call(Pid, stop).
new_pool(Size, MaxOverflow) ->
poolboy:start_link([{name, {local, poolboy_test}},
{worker_module, poolboy_test_worker},
{size, Size}, {max_overflow, MaxOverflow}]).
pool_call(ServerRef, Request) ->
gen_server:call(ServerRef, Request).
pool_startup_no_stop() ->
new_pool_no_link(1, 0).
new_pool_no_link(Size, MaxOverflow) ->
poolboy:start([{name, {local, poolboy_test}},
{worker_module, poolboy_test_worker},
{size, Size}, {max_overflow, MaxOverflow}]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.