Class: OnlineMigrations::ConstantLockRetrier
- Inherits:
-
LockRetrier
- Object
- LockRetrier
- OnlineMigrations::ConstantLockRetrier
- Defined in:
- lib/online_migrations/lock_retrier.rb
Overview
‘LockRetrier` implementation that has a constant delay between tries and lock timeout for each try
Instance Attribute Summary collapse
-
#attempts ⇒ Integer
readonly
LockRetrier API implementation.
Attributes inherited from LockRetrier
Instance Method Summary collapse
-
#delay(_attempt) ⇒ Numeric
LockRetrier API implementation.
-
#initialize(attempts:, delay:, lock_timeout: nil) ⇒ ConstantLockRetrier
constructor
Create a new ConstantLockRetrier instance.
-
#lock_timeout(_attempt) ⇒ Numeric
LockRetrier API implementation.
Methods inherited from LockRetrier
Constructor Details
#initialize(attempts:, delay:, lock_timeout: nil) ⇒ ConstantLockRetrier
Create a new ConstantLockRetrier instance
146 147 148 149 150 151 |
# File 'lib/online_migrations/lock_retrier.rb', line 146 def initialize(attempts:, delay:, lock_timeout: nil) super() @attempts = attempts @delay = delay @lock_timeout = lock_timeout end |
Instance Attribute Details
#attempts ⇒ Integer (readonly)
LockRetrier API implementation
138 139 140 |
# File 'lib/online_migrations/lock_retrier.rb', line 138 def attempts @attempts end |
Instance Method Details
#delay(_attempt) ⇒ Numeric
LockRetrier API implementation
167 168 169 |
# File 'lib/online_migrations/lock_retrier.rb', line 167 def delay(_attempt) @delay end |
#lock_timeout(_attempt) ⇒ Numeric
LockRetrier API implementation
158 159 160 |
# File 'lib/online_migrations/lock_retrier.rb', line 158 def lock_timeout(_attempt) @lock_timeout end |