Class: Sidekiq::RedisClientAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/redis_client_adapter.rb

Defined Under Namespace

Modules: CompatMethods Classes: CompatClient

Constant Summary collapse

BaseError =
RedisClient::Error
CommandError =
RedisClient::CommandError
DEPRECATED_COMMANDS =

You can add/remove items or clear the whole thing if you don’t want deprecation warnings.

%i[rpoplpush zrangebyscore zrevrange zrevrangebyscore getset hmset setex setnx].to_set

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RedisClientAdapter

Returns a new instance of RedisClientAdapter.



63
64
65
66
67
68
69
70
# File 'lib/sidekiq/redis_client_adapter.rb', line 63

def initialize(options)
  opts = client_opts(options)
  @config = if opts.key?(:sentinels)
    RedisClient.sentinel(**opts)
  else
    RedisClient.config(**opts)
  end
end

Instance Method Details

#new_clientObject



72
73
74
# File 'lib/sidekiq/redis_client_adapter.rb', line 72

def new_client
  CompatClient.new(@config.new_client)
end