Class: Circuitry::Locks::Memcache

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/circuitry/locks/memcache.rb

Constant Summary

Constants included from Base

Base::DEFAULT_HARD_TTL, Base::DEFAULT_SOFT_TTL

Instance Attribute Summary

Attributes included from Base

#hard_ttl, #soft_ttl

Instance Method Summary collapse

Methods included from Base

#hard_lock, #soft_lock, #unlock

Constructor Details

#initialize(options = {}) ⇒ Memcache

Returns a new instance of Memcache.


6
7
8
9
10
11
12
13
# File 'lib/circuitry/locks/memcache.rb', line 6

def initialize(options = {})
  super(options)

  self.client = options.fetch(:client) do
    require 'dalli'
    ::Dalli::Client.new(options[:host], options)
  end
end