Closed stoivo closed 1 year ago
Your question is too vague for me to answer with certainty.
But if the question is how to manage a redis connection pool to use across a Rails app, then something like:
module MyApp
class << self
attr_reader :redis_pool
end
@redis_pool = ConnectionPool.new(...) { Redis.new(...) }
end
Yes , that was my question, how to manage it for a rails app.
I suspect you missed an end
in you sample, @redis_pool
should be in the class << self
?
I suspect you missed an
end
in you sample
Indeed.
@redis_pool should be in the class << self?
Nope, that part wasn't a mistake :)
Hi,
How do you recommend setting this up with rails. I always wonder. How would bit be best to set this up. Global variables isn't great but it works...