Class: Circuitry::Locks::Redis

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/circuitry/locks/redis.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 = {}) ⇒ Redis

Returns a new instance of Redis.


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

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

  self.client = options.fetch(:client) do
    require 'redis'
    ::Redis.new(options)
  end
end