- a lightweight erlang process pool inspired from pool-boy, erl-pool, cue-sport, revolver
- simple and fast
- easy to integrate in your project
{deps, [
...
{volley, {git, "https://github.com/QCute/volley.git", {branch, "master"}}}
]}.
- define a worker
-module(test).
-export([start_link/0]).
start_link() ->
loop().
loop() ->
receive
Msg ->
io:format("receive: ~p~n", [Msg]),
loop()
end.
- start worker pool
PoolArgs = [{worker, {test, start_link, []}}, {size, 4}],
volley:start_pool(a_pool, PoolArgs).
- get a worker
Worker = volley:get(a_pool),
%% do something ...