class Stud::Pool

Public: A thread-safe, generic resource pool.

This class is agnostic as to the resources in the pool. You can put database connections, sockets, threads, etc. It’s up to you!

Examples:

pool = Pool.new
pool.add(Sequel.connect("postgres://pg-readonly-1/prod"))
pool.add(Sequel.connect("postgres://pg-readonly-2/prod"))
pool.add(Sequel.connect("postgres://pg-readonly-3/prod"))

pool.fetch # =>  Returns one of the Sequel::Database values from the pool