Class: Fractor::Workflow::ConstantDelay
- Inherits:
-
RetryStrategy
- Object
- RetryStrategy
- Fractor::Workflow::ConstantDelay
- Defined in:
- lib/fractor/workflow/retry_strategy.rb
Overview
Constant delay retry strategy
Instance Attribute Summary collapse
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
Attributes inherited from RetryStrategy
Instance Method Summary collapse
- #delay_for(attempt) ⇒ Object
-
#initialize(delay: 1, **options) ⇒ ConstantDelay
constructor
A new instance of ConstantDelay.
Constructor Details
#initialize(delay: 1, **options) ⇒ ConstantDelay
Returns a new instance of ConstantDelay.
70 71 72 73 |
# File 'lib/fractor/workflow/retry_strategy.rb', line 70 def initialize(delay: 1, **) super(**) @delay = delay end |
Instance Attribute Details
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
68 69 70 |
# File 'lib/fractor/workflow/retry_strategy.rb', line 68 def delay @delay end |
Instance Method Details
#delay_for(attempt) ⇒ Object
75 76 77 78 79 |
# File 'lib/fractor/workflow/retry_strategy.rb', line 75 def delay_for(attempt) return 0 if attempt <= 1 cap_delay(delay) end |