module Sidekiq::Grouping::RedisDispatcher

Public Instance Methods

new_redis_client?() click to toggle source
# File lib/sidekiq/grouping/redis_dispatcher.rb, line 20
def new_redis_client?
  Sidekiq::VERSION[0].to_i >= 7
end
redis(&block) click to toggle source
# File lib/sidekiq/grouping/redis_dispatcher.rb, line 24
def redis(&block)
  Sidekiq.redis(&block)
end
redis_call(command, *args, **kwargs) click to toggle source
# File lib/sidekiq/grouping/redis_dispatcher.rb, line 6
def redis_call(command, *args, **kwargs)
  redis do |connection|
    redis_connection_call(connection, command, *args, **kwargs)
  end
end
redis_connection_call(connection, command, *args, **kwargs) click to toggle source
# File lib/sidekiq/grouping/redis_dispatcher.rb, line 12
def redis_connection_call(connection, command, *args, **kwargs)
  if new_redis_client? # redis-client
    connection.call(command.to_s.upcase, *args, **kwargs)
  else # redis
    connection.public_send(command, *args, **kwargs)
  end
end