Module: RaceGuard::Distributed::LockStore
- Included in:
- MemoryLockStore, RedisLockStore
- Defined in:
- lib/race_guard/distributed/lock_store.rb
Overview
Pluggable mutual-exclusion backend for RaceGuard.distributed_once.
Implementations must be thread-safe for concurrent claim calls on the same key.
Instance Method Summary collapse
-
#claim(key:, token:, ttl:) ⇒ Boolean
True if this caller now owns the lock.
-
#release(key:, token:) ⇒ Boolean
True if the key was deleted and matched
token. -
#renew(key:, token:, ttl:) ⇒ Boolean
True if TTL was extended for the same owner token.
Instance Method Details
#claim(key:, token:, ttl:) ⇒ Boolean
Returns true if this caller now owns the lock.
20 21 |
# File 'lib/race_guard/distributed/lock_store.rb', line 20 module LockStore end |
#release(key:, token:) ⇒ Boolean
Returns true if the key was deleted and matched token.
20 21 |
# File 'lib/race_guard/distributed/lock_store.rb', line 20 module LockStore end |
#renew(key:, token:, ttl:) ⇒ Boolean
Returns true if TTL was extended for the same owner token.
20 21 |
# File 'lib/race_guard/distributed/lock_store.rb', line 20 module LockStore end |