Class: Moneta::Lock
Overview
Locks the underlying stores with a Mutex
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
-
#initialize(adapter, options = {}) ⇒ Lock
constructor
A new instance of Lock.
Methods inherited from Wrapper
#clear, #close, #delete, #increment, #key?, #load, #store
Methods inherited from Proxy
#clear, #close, #delete, #increment, #key?, #load, #store
Methods included from Defaults
#[], #[]=, #close, #decrement, #fetch, #increment, #key?
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
#initialize(adapter, options = {}) ⇒ Lock
Returns a new instance of Lock.
10 11 12 13 |
# File 'lib/moneta/lock.rb', line 10 def initialize(adapter, = {}) super @lock = [:mutex] || Mutex.new end |