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

Support redis cluster client #108

Merged
merged 1 commit into from
Oct 12, 2021
Merged

Support redis cluster client #108

merged 1 commit into from
Oct 12, 2021

Conversation

si3nloong
Copy link
Contributor

@si3nloong si3nloong commented Sep 11, 2021

This PR will allow us to pass redis client or redis cluster client, example :

var client redis.Cmdable
if cluster {
  client = redis.NewClusterClient(&redis.ClusterOptions{
	  Addrs:    []string{"127.0.0.1:8000", "127.0.0.1: 8001"},
  })
} else {
  client = redis.NewClient(&redis.Options{
	  Addr:    "127.0.0.1:8000",
  })
}

errChan := make(chan error, 1)
rmq.OpenConnectionWithRedisClient("queue-name", client, errChan)

Noted: There have no breaking change in this PR, as long as we are using redis/v8 (this will comply to the interface)

@si3nloong si3nloong changed the title 🎨 feat: change *redis.Client to redis.Cmable interface to support… Enable support redis cluster client Sep 11, 2021
@si3nloong si3nloong changed the title Enable support redis cluster client Support redis cluster client Sep 11, 2021
@wellle
Copy link
Member

wellle commented Oct 12, 2021

Seems good, thank you!

@wellle wellle merged commit 2c37533 into adjust:master Oct 12, 2021
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