Module: RedisQueuedLocks::Acquirer::AcquireLock::DelayExecution Private
- Included in:
- RedisQueuedLocks::Acquirer::AcquireLock
- Defined in:
- lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.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.
Instance Method Summary collapse
-
#delay_execution(retry_delay, retry_jitter) ⇒ Integer
private
Sleep with random time-shifting (it is necessary for empty lock-acquirement time slots).
Instance Method Details
#delay_execution(retry_delay, retry_jitter) ⇒ Integer
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.
Sleep with random time-shifting (it is necessary for empty lock-acquirement time slots).
14 15 16 17 |
# File 'lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.rb', line 14 def delay_execution(retry_delay, retry_jitter) delay = (retry_delay + ::Kernel.rand(retry_jitter)).to_f / 1_000 ::Kernel.sleep(delay) end |