Class: Bogo::Retry::Exponential
- Inherits:
-
Bogo::Retry
- Object
- Bogo::Retry
- Bogo::Retry::Exponential
- Defined in:
- lib/bogo/retry.rb
Overview
Exponential retry implementation
Instance Attribute Summary collapse
- #wait_exponent ⇒ Numeric readonly
- #wait_interval ⇒ Numeric readonly
Attributes inherited from Bogo::Retry
#action, #attempts, #dead, #description, #max_attempts, #ui
Instance Method Summary collapse
-
#initialize(args = {}, &block) ⇒ self
constructor
Create a new linear retry instance.
Methods inherited from Bogo::Retry
Constructor Details
#initialize(args = {}, &block) ⇒ self
Create a new linear retry instance
181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/bogo/retry.rb', line 181 def initialize(args={}, &block) @wait_interval = args[:wait_interval].to_f @wait_exponent = args[:wait_exponent].to_f unless(@wait_interval > 0) @wait_interval = 5 end unless(@wait_exponent > 0) @wait_exponent = 2 end super end |
Instance Attribute Details
#wait_exponent ⇒ Numeric (readonly)
173 174 175 |
# File 'lib/bogo/retry.rb', line 173 def wait_exponent @wait_exponent end |
#wait_interval ⇒ Numeric (readonly)
171 172 173 |
# File 'lib/bogo/retry.rb', line 171 def wait_interval @wait_interval end |