Permalink
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 370 Bytes
-module(boss_pool).
-export([call/2, call/3]).
call(Pool, Msg) ->
Worker = poolboy:checkout(Pool),
Reply = gen_server:call(Worker, Msg),
poolboy:checkin(Pool, Worker),
Reply.
call(Pool, Msg, Timeout) ->
Worker = poolboy:checkout(Pool, true, Timeout),
Reply = gen_server:call(Worker, Msg, Timeout),
poolboy:checkin(Pool, Worker),
Reply.