Generic Erlang resource pool