Skip to content

support redis-rb 4.0.0 - #136

Merged
fw42 merged 5 commits into
resque:masterfrom
ota42y:feature/redis_4
Sep 25, 2017
Merged

fw42 merged 5 commits into
resque:masterfrom
ota42y:feature/redis_4

Conversation

@ota42y

@ota42y ota42y commented Sep 8, 2017

Copy link
Copy Markdown
Contributor

The redis-rb 4.0.0 remove [] and []= method alias.
So we must use get/set method.

And client method was broken changed.
redis/redis-rb@3138507

We must use the _client method for same behavier.
redis/redis-rb@c239abb

But if we remove client method, it's broken changes, so I alias client method to _client.
The user can be used redis-naespace 1.x with both redis-3.x and redis-4.x and can be gradually update.

@ota42y

ota42y commented Sep 22, 2017

Copy link
Copy Markdown
Contributor Author

@fw42
This feature doesn't changed the original behavior, I think it's no problem.
And this feature enable using redis-rb v4.0.0, so this is very useful for redis-namespace user.

@fw42 fw42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two small comments but looks almost good to me

Comment thread lib/redis/namespace.rb Outdated
@deprecations = !!options.fetch(:deprecations) do
ENV['REDIS_NAMESPACE_DEPRECATIONS']
end
@is_client_respond = @redis.respond_to?(:_client)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd call this something like @has_new_client_method or @responds_to_new_client_method... or maybe just @new_client_method.

Comment thread lib/redis/namespace.rb Outdated
def client
@redis.client
warn("The `client` method broken changed by redis-rb 4.0.0, so we should use `_client` method." +
"`client` method in redis-namespace will remove 2.0 (at #{call_site})") if @is_client_respond

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd say something like

The client method is deprecated as of redis-rb 4.0.0, please use the new _client method instead. Support for the old method will be removed in redis-namespace 2.0.

@ota42y

ota42y commented Sep 23, 2017

Copy link
Copy Markdown
Contributor Author

@fw42

Fixed!
Thank you for advice of more correct English expression

@fw42 fw42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

WFM. @hkdsun?

@hkdsun hkdsun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@fw42
fw42 merged commit 1403f51 into resque:master Sep 25, 2017
@ota42y
ota42y deleted the feature/redis_4 branch September 25, 2017 23:51
@ota42y

ota42y commented Sep 25, 2017

Copy link
Copy Markdown
Contributor Author

Thanks!
And when will we release the version containing this change?

@jeremy

jeremy commented Sep 29, 2017

Copy link
Copy Markdown
Contributor

resque-scheduler support for redis-rb 4.0 (resque/resque-scheduler#620) is pending a gem release it can depend on.

jeremy added a commit to jeremy/sidekiq that referenced this pull request Sep 29, 2017
* Loosen Redis version dep to `>= 3.3.5, < 5`
* Bump redis-namespace for looser Redis version dep. Pending
  resque/redis-namespace#136 gem release.

Use `redis.connection` where we can and fall back to `redis._client`
where we need (to inspect timeout and scheme).

References sidekiq#3617
jeremy added a commit to jeremy/sidekiq that referenced this pull request Sep 29, 2017
* Loosen Redis version dep to `>= 3.3.5, < 5`
* Bump redis-namespace for looser Redis version dep. Pending
  resque/redis-namespace#136 gem release.

Use `redis.connection` where we can and fall back to `redis._client`
where we need (to inspect timeout and scheme).

References sidekiq#3617
mperham pushed a commit to sidekiq/sidekiq that referenced this pull request Sep 29, 2017
* Loosen Redis version dep to `>= 3.3.5, < 5`
* Bump redis-namespace for looser Redis version dep. Pending
  resque/redis-namespace#136 gem release.

Use `redis.connection` where we can and fall back to `redis._client`
where we need (to inspect timeout and scheme).

References #3617
@koenrh koenrh mentioned this pull request Oct 15, 2017
@manuelmeurer

Copy link
Copy Markdown

Could you release a new gem version with Redis v4 support? 😸 Thanks!

@ota42y

ota42y commented Oct 29, 2017

Copy link
Copy Markdown
Contributor Author

@fw42
Hi! could you release new version?
I want to use redis 4 😃

Comment thread redis-namespace.gemspec
s.files += Dir.glob("spec/**/*")

s.add_dependency "redis", "~> 3.0", ">= 3.0.4"
s.add_dependency "redis", ">= 3.0.4"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not <5?

@jeremy

jeremy commented Nov 15, 2017

Copy link
Copy Markdown
Contributor

1.6.0 was released

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.

6 participants