Open
Description
I think we can handle this by accepting a list of URI
s in Client#initialize
and assigning them at random in the connection pool block.
Thinking something like this:
# Keep this method signature for backwards-compatibility
def self.new(uri : URI)
max_idle_pool_size = uri.query_params.fetch("max_idle_pool_size", "25").to_i
new([uri], max_idle_pool_size)
end
def initialize(uris : Array(URI) = [URI.parse("redis:///")], max_idle_pool_size : Int = 25)
@pool = DB::Pool.new(
max_idle_pool_size: max_idle_pool_size.to_i32,
) { Connection.new(uris.sample) }
end
Metadata
Metadata
Assignees
Labels
No labels