redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
124 stars 60 forks source link

Expose basic config details for RedisClient #144

Closed slai11 closed 11 months ago

slai11 commented 11 months ago

This pull request exposes the basic configuration details on RedisClient via instance methods, referencing the configuration values in available in Redis::Client (https://github.com/redis/redis-rb/blob/2b183addb9175641a48e1d8616772282a31c0532/lib/redis/client.rb#L48-L82).

This should close the gap between the raw RedisClient for sentinels and Redis::Client for standalone Redis. More context can be found in this issue: https://github.com/redis/redis-rb/issues/1231

casperisfine commented 11 months ago

Thank you!

slai11 commented 11 months ago

@casperisfine sorry for the ping on this, but is there a release schedule for fixes in redis-client? I'm guessing this will go out in v0.17.2.

casperisfine commented 11 months ago

Yeah sorry. Can you use a git branch to double check it solves the issue with redis-rb ? Once you have confirmed it I can release both.

slai11 commented 11 months ago

I prepared a branch on my fork that uses master branch of this project. https://github.com/slai11/redis-rb/tree/slai11-demo-fix

➜  redis-rb git:(slai11-demo-fix) ✗ bin/console
irb(main):001:0> sentinel = Redis.new({:password=>"password123",:name=>"mymaster", :sentinels=>[{:host=>"localhost", :port=>26480, :password=>"password456"},{:host=>"localhost", :port=>26481, :password=>"password456"},{:host=>"loc
alhost", :port=>26482, :password=>"password456"}]})
=> #<Redis client v5.0.8 for redis://127.0.0.1:6480/0>
irb(main):002:0> sentinel.connection
=> {:host=>"127.0.0.1", :port=>6480, :db=>0, :id=>"redis://127.0.0.1:6480/0", :location=>"127.0.0.1:6480"}
irb(main):003:0> exit

Would that suffice as a check?

casperisfine commented 11 months ago

0.18.0 is out.