Class: WarpCore::RedisPoolInstance

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

Overview

Because Sidekiq.redis requires passing a block, we can’t pass it straight to Redis::Semaphore. This class simply delegates every method call to the Sidekiq connection. use RedisPoolInstance.new to get a shared redis connection

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



62
63
64
65
66
# File 'lib/warpcore/sidekiq.rb', line 62

def method_missing(meth, *args, &block)
  Sidekiq.redis do |connection|
    connection.send(meth, *args, &block)
  end
end

Instance Method Details

#respond_to_missing?(meth) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
71
72
# File 'lib/warpcore/sidekiq.rb', line 68

def respond_to_missing?(meth)
  Sidekiq.redis do |connection|
    connection.respond_to?(meth)
  end
end