Module: RedisQueuedLocks::Acquirer::IsLocked Private

Defined in:
lib/redis_queued_locks/acquirer/is_locked.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.locked?(redis_client, lock_name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • redis_client (RedisClient)
  • lock_name (String)

Returns:

  • (Boolean)

Since:

  • 1.0.0



13
14
15
16
# File 'lib/redis_queued_locks/acquirer/is_locked.rb', line 13

def locked?(redis_client, lock_name)
  lock_key = RedisQueuedLocks::Resource.prepare_lock_key(lock_name)
  redis_client.call('EXISTS', lock_key) == 1
end