Skip to content
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

added support for redis connection pools #839

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

j-castellanos
Copy link

To solve this issue #609 in a DRY way I simply wrap all the public methods in the existing redis adapter

@j-castellanos
Copy link
Author

@jnunemaker could you rerun the failed test?

@bkeepers
Copy link
Collaborator

@j-castellanos Thanks for the PR!

In #826 (review) I offered a couple suggestions of how I think we should approach connection pool support. I don't really love having different adapters Redis depending on if you're using the client directly or a connection pool. I'd rather see Redis and RedisCache updated to work directly with a client or a pool internally, or add a generic ConnectionPool adapter as attempted in #835.

I don't feel strongly between those two approaches, but I would like to make sure we add connection pool support to both Redis and RedisCache at the same time.

Thoughts?

@j-castellanos
Copy link
Author

@bkeepers how is this?

removing idea

fixing specs
def initialize(client_or_pool = nil, key_prefix: nil)
@pool = nil
@client = nil
if client_or_pool.respond_to?(:with)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe is_a?(ConnectionPool) might be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants