|
@@ -437,22 +437,6 @@ remove_pid(Pid, Pool) ->
|
|
|
Pool
|
|
|
end.
|
|
|
|
|
|
--spec max_free_pool(dict()) -> error_no_members | string().
|
|
|
-max_free_pool(Pools) ->
|
|
|
- case dict:fold(fun fold_max_free_count/3, {"", 0}, Pools) of
|
|
|
- {"", 0} -> error_no_members;
|
|
|
- {MaxFreePoolName, _} -> MaxFreePoolName
|
|
|
- end.
|
|
|
-
|
|
|
--spec fold_max_free_count(string(), #pool{}, {string(), non_neg_integer()}) ->
|
|
|
- {string(), non_neg_integer()}.
|
|
|
-fold_max_free_count(Name, Pool, {CName, CMax}) ->
|
|
|
- case Pool#pool.free_count > CMax of
|
|
|
- true -> {Name, Pool#pool.free_count};
|
|
|
- false -> {CName, CMax}
|
|
|
- end.
|
|
|
-
|
|
|
-
|
|
|
-spec start_n_pids(non_neg_integer(), atom() | pid(), pid(), dict()) ->
|
|
|
{dict(), [pid()]}.
|
|
|
start_n_pids(N, PoolName, PoolSup, AllMembers) ->
|