Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Moneta::Lock

Locks the underlying stores with a Mutex @api public

Public Class Methods

new(adapter, options = {}) click to toggle source

@param [Moneta store] adapter The underlying store @param [Hash] options @option options [String] :mutex (::Mutex.new) Mutex object

# File lib/moneta/lock.rb, line 10
def initialize(adapter, options = {})
  super
  @lock = options[:mutex] || ::Mutex.new
end

Protected Instance Methods

wrap(*args, &block) click to toggle source
# File lib/moneta/lock.rb, line 17
def wrap(*args, &block)
  @lock.synchronize(&block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.