Class: RedisReadWriteLocks::WriteLock

Inherits:
BaseLock
  • Object
show all
Defined in:
lib/redis_read_write_locks/write_lock.rb

Constant Summary

Constants inherited from BaseLock

BaseLock::DEFAULT_TTL, BaseLock::RETRY_INTERVAL

Instance Attribute Summary

Attributes inherited from BaseLock

#name, #token

Instance Method Summary collapse

Methods inherited from BaseLock

#acquire, #acquired?, #initialize, #synchronize

Constructor Details

This class inherits a constructor from RedisReadWriteLocks::BaseLock

Instance Method Details

#releaseObject



3
4
5
6
7
8
9
# File 'lib/redis_read_write_locks/write_lock.rb', line 3

def release
  return false unless @acquired

  eval_script(LockScripts::RELEASE_WRITE, keys: [writer_key], argv: [@token])
  @acquired = false
  true
end