Class: JetstreamBridge::ExponentialBackoffStrategy
- Inherits:
-
RetryStrategy
- Object
- RetryStrategy
- JetstreamBridge::ExponentialBackoffStrategy
- Defined in:
- lib/jetstream_bridge/core/retry_strategy.rb
Overview
Exponential backoff retry strategy
Instance Method Summary collapse
-
#initialize(max_attempts: 3, base_delay: 0.1, max_delay: 60, multiplier: 2, transient_errors: [], jitter: true) ⇒ ExponentialBackoffStrategy
constructor
A new instance of ExponentialBackoffStrategy.
Methods inherited from RetryStrategy
Constructor Details
#initialize(max_attempts: 3, base_delay: 0.1, max_delay: 60, multiplier: 2, transient_errors: [], jitter: true) ⇒ ExponentialBackoffStrategy
75 76 77 78 79 80 81 82 |
# File 'lib/jetstream_bridge/core/retry_strategy.rb', line 75 def initialize(max_attempts: 3, base_delay: 0.1, max_delay: 60, multiplier: 2, transient_errors: [], jitter: true) @base_delay = base_delay @max_delay = max_delay @multiplier = multiplier @jitter = jitter backoffs = compute_backoffs(max_attempts) super(max_attempts: max_attempts, backoffs: backoffs, transient_errors: transient_errors) end |