Skip to content

Add option to use a different Connector. #591

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

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Mar 3, 2016

No description provided.

@badboy
Copy link
Contributor

badboy commented Mar 3, 2016

What would be the use case of this?

@tgxworld
Copy link
Contributor Author

tgxworld commented Mar 3, 2016

I'm trying to run a custom connector without having to monkey patch. Basically have the ability to subclass Redis::Client::Connector easily.

In my case, I'm not using sentinals for HA. We run a master slave config and would like to have a custom connector that handles the failover.

@tgxworld
Copy link
Contributor Author

tgxworld commented Mar 7, 2016

@badboy I would like to clarify if the request is reasonable :)

@SamSaffron
Copy link
Contributor

@badboy any news on this? need to know if its acceptable or not, I hate carrying freedom patches around for Discourse :)

@SamSaffron
Copy link
Contributor

see:

discourse/discourse#4056

@SamSaffron
Copy link
Contributor

@badboy any news on this issue?

@tgxworld
Copy link
Contributor Author

ping @djanowski Any thoughts about this?

@tgxworld
Copy link
Contributor Author

@badboy @djanowski Don't mean to ping multiple times but we would love to get some feedback on this.

@tgxworld
Copy link
Contributor Author

@byroot Was wondering if you might have any thoughts on this.

Copy link
Collaborator

@byroot byroot left a comment

Choose a reason for hiding this comment

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

LGTM.

@rafaelfranca WDYT ?

@connector =
if options.include?(:sentinels)
Connector::Sentinel.new(@options)
elsif options.include?(:connector) && options[:connector].is_a?(Class)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't check for is_a?(Class), respond_to?(:new) would be better as it would allow for facades etc.

@tgxworld tgxworld force-pushed the allow_custom_connectors branch from 8f06607 to 088b8c6 Compare June 4, 2018 02:38
@tgxworld
Copy link
Contributor Author

tgxworld commented Jun 4, 2018

@byroot Thank you for reviewing. I've updated the PR as per your comments and added tests as well.

@byroot byroot merged commit ddf058b into redis:master Jun 4, 2018
@tgxworld tgxworld deleted the allow_custom_connectors branch June 4, 2018 13:32
@tgxworld
Copy link
Contributor Author

tgxworld commented Jun 4, 2018

@byroot Thank you for reviewing. Just curious, is Shopify/Rails taking up ownership of this gem now?

@byroot
Copy link
Collaborator

byroot commented Jun 4, 2018

A few people from Shopify have been added as collaborators on the repo indeed. We should also get Rubygems access some day so we can release new versions as well.

@tgxworld
Copy link
Contributor Author

tgxworld commented Jun 4, 2018

Awesome 👍 Thanks for reviewing once again!

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.

4 participants