lib/liszt/redis_list.rb
# Obtain an exclusive lock on the list, execute the given block, and then
# release the lock. If the lock is currently taken by someone else, we just
# block until it becomes available.
Obtain an exclusive lock on the list, execute the given block, and then
release the lock. If the lock is currently taken by someone else, we just
block until it becomes available.
Obtain an exclusive lock on the list execute the given block and then release the lock . If the lock is currently taken by someone else we just block until it becomes available .
def with_lock
        start_time = Time.now
        until get_lock
          sleep 0.2
          raise "Timed out!" if (Time.now - start_time) > 10
        end
        yield
      ensure
        release_lock
      end
def with_lock start_time = Time . now until get_lock sleep 0.2 raise "Timed out!" if ( Time . now - start_time ) > 10 end yield ensure release_lock end
Obtain an exclusive lock on the list, execute the given block, and then
release the lock.
Obtain an exclusive lock on the list execute the given block and then release the lock .