Module: Adocca::Synchronized

Defined in:
lib/am_memcache.rb

Overview

Extend this module to be able to magically synchronize on any object, just like in Java(tm)!

Instance Method Summary collapse

Instance Method Details

#synchronize(&block) ⇒ Object



13
14
15
16
17
18
# File 'lib/am_memcache.rb', line 13

def synchronize(&block)
  raise "Adocca::Synchronized::CACHE is not defined!" unless defined?(Adocca::Synchronized::CACHE)
  Adocca::Synchronized::CACHE.synchronize(self.inspect) do
    yield
  end
end