module Sidekiq::RedisClientAdapter::CompatMethods
Constants
- USED_COMMANDS
-
this is the set of Redis commands used by
Sidekiq
. Not guaranteed to be comprehensive, we use this as a performance enhancement to avoid callingmethod_missing
on most commands
Public Instance Methods
Source
# File lib/sidekiq/redis_client_adapter.rb, line 19 def evalsha(sha, keys, argv) @client.call("EVALSHA", sha, keys.size, *keys, *argv) end
Source
# File lib/sidekiq/redis_client_adapter.rb, line 15 def info @client.call("INFO") { |i| i.lines(chomp: true).map { |l| l.split(":", 2) }.select { |l| l.size == 2 }.to_h } end
Private Instance Methods
Source
# File lib/sidekiq/redis_client_adapter.rb, line 43 def method_missing(*args, &block) warn("[sidekiq#5788] Redis has deprecated the `#{args.first}`command, called at #{caller(1..1)}") if DEPRECATED_COMMANDS.include?(args.first) @client.call(*args, *block) end
this allows us to use methods like ‘conn.hmset(…)` instead of having to use redis-client’s native ‘conn.call(“hmset”, …)`
Source
# File lib/sidekiq/redis_client_adapter.rb, line 49 def respond_to_missing?(name, include_private = false) super # Appease the linter. We can't tell what is a valid command. end
Calls superclass method