Class: Factorix::HTTP::RetryStrategy
- Inherits:
-
Object
- Object
- Factorix::HTTP::RetryStrategy
- Defined in:
- lib/factorix/http/retry_strategy.rb
Overview
Class that manages retry strategy with exponential backoff and randomization
Instance Method Summary collapse
-
#initialize(logger: nil, **options) ⇒ RetryStrategy
constructor
Initialize a new retry strategy with customizable options.
-
#with_retry { ... } ⇒ Object
Execute the block with automatic retry on specified exceptions.
Constructor Details
#initialize(logger: nil, **options) ⇒ RetryStrategy
Initialize a new retry strategy with customizable options
43 44 45 46 |
# File 'lib/factorix/http/retry_strategy.rb', line 43 def initialize(logger: nil, **) super(logger:) @options = () end |
Instance Method Details
#with_retry { ... } ⇒ Object
Execute the block with automatic retry on specified exceptions. Uses exponential backoff with randomization for retry intervals
54 |
# File 'lib/factorix/http/retry_strategy.rb', line 54 def with_retry(&) = Retriable.retriable(**@options, &) |