Class: Sidekiq::Status::RedisAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq-status/redis_adapter.rb

Overview

adapter for redis-rb client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RedisAdapter

Returns a new instance of RedisAdapter.



3
4
5
# File 'lib/sidekiq-status/redis_adapter.rb', line 3

def initialize(client)
  @client = client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



15
16
17
# File 'lib/sidekiq-status/redis_adapter.rb', line 15

def method_missing(method, *args)
  @client.send(method, *args)
end

Instance Method Details

#scan(**options, &block) ⇒ Object



7
8
9
# File 'lib/sidekiq-status/redis_adapter.rb', line 7

def scan(**options, &block)
  @client.scan_each(**options, &block)
end

#schedule_batch(key, options) ⇒ Object



11
12
13
# File 'lib/sidekiq-status/redis_adapter.rb', line 11

def schedule_batch(key, options)
  @client.zrangebyscore key, options[:start], options[:end], limit: [options[:offset], options[:limit]]
end