class Mcache::Connection

Public Class Methods

new(host, size, timeout = 5, options = {}) click to toggle source
# File lib/mcache/connection.rb, line 5
def initialize(host, size, timeout = 5, options = {})
  @pool = ConnectionPool.new(size: size, timeout: timeout) do
    Dalli::Client.new(host, options)
  end
end

Public Instance Methods

run() { |cn| ... } click to toggle source
# File lib/mcache/connection.rb, line 11
def run
  @pool.with do |cn|
    yield(cn)
  end
end