class Redcord::ConnectionPool

Public Class Methods

new(pool_size:, timeout:, **client_options) click to toggle source
# File lib/redcord/connection_pool.rb, line 6
def initialize(pool_size:, timeout:, **client_options)
  @connection_pool = ::ConnectionPool.new(size: pool_size, timeout: timeout) do
    # Construct a new client every time the block gets called
    Redcord::Redis.new(**client_options, logger: Redcord::Logger.proxy)
  end
end

Public Instance Methods

method_missing(method_name, *args, &blk) click to toggle source
# File lib/redcord/connection_pool.rb, line 23
def method_missing(method_name, *args, &blk)
  @connection_pool.with do |redis|
    redis.send(method_name, *args, &blk)
  end
end