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 calling method_missing on most commands

Public Instance Methods

evalsha(sha, keys, argv) click to toggle source
# File lib/sidekiq/redis_client_adapter.rb, line 20
def evalsha(sha, keys, argv)
  @client.call("EVALSHA", sha, keys.size, *keys, *argv)
end
info() click to toggle source
# File lib/sidekiq/redis_client_adapter.rb, line 16
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

method_missing(*args, &block) click to toggle source

this allows us to use methods like ‘conn.hmset(…)` instead of having to use redis-client’s native ‘conn.call(“hmset”, …)`

# File lib/sidekiq/redis_client_adapter.rb, line 44
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
respond_to_missing?(name, include_private = false) click to toggle source
Calls superclass method
# File lib/sidekiq/redis_client_adapter.rb, line 50
def respond_to_missing?(name, include_private = false)
  super # Appease the linter. We can't tell what is a valid command.
end