Skip to content

Instantly share code, notes, and snippets.

@aronisstav
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aronisstav/b67df16361cd9a2fa87e to your computer and use it in GitHub Desktop.
Save aronisstav/b67df16361cd9a2fa87e to your computer and use it in GitHub Desktop.
%% 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