-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection pool support #609
Comments
I have this to proxy methods through a connection pool but it is not as optimal as native support: class ConnectionPoolProxy
def initialize(pool)
@pool = pool
@instance_class = pool.with(&:class)
end
def method_missing(method_name, *args, &block)
@pool.with { |instance| instance.public_send(method_name, *args, &block) }
end
def respond_to_missing?(method_name, _ = false)
@instance_class.public_instance_methods.include?(method_name.to_sym)
end
end |
You can also just make a new flipper adapter. That said, I'm cool with a RedisConnectionPool adapter in flipper. Seems good to me. |
I'm going to close this issue to keep things tidy but if you have any more questions let me know. Happy to merge a PR for a connection pool adapter. |
Also if I wasn't clear before, which re-reading I'm wondering if I was, what I meant is we could add RedisConnectionPool adapter in flipper. I'd start by copying the redis one and then adding the necessary |
@jnunemaker Did anything ever come of this? It would be really great to have an adapter that use the Redis connection pool. |
It would also be great to have connection pool support for Redis in the RedisCache adapter. |
@cymen no, but we'd gladly accept a pull request that adds a Redis connection pool adapter. |
Just wanted to say that I would love to see one of these solutions make it in :) |
Instead of a new connection for each flipper instance, it would be nice to use connection pooling.
In
config/initializers/redis.rb
we have:in
config/initializers/flipper.rb
we want to do the following:However this fails when using flipper since the methods required for redis are not defined on the connection pool. To access the redis methods you have to do:
Do you think we can add support? I'm happy to work on it
The text was updated successfully, but these errors were encountered: