Class: ElephantInTheRoom::TheOneApiSdk::Pipeline::Retry
- Inherits:
-
Object
- Object
- ElephantInTheRoom::TheOneApiSdk::Pipeline::Retry
- Defined in:
- lib/elephant_in_the_room/the_one_api_sdk/pipeline/retry.rb
Overview
Pipeline stage to run a given retry strategy
Instance Method Summary collapse
- #execute_http_request(request_details) ⇒ Object
- #http_response ⇒ Object
-
#initialize(next_pipeline_stage, retry_strategy) ⇒ Retry
constructor
A new instance of Retry.
Constructor Details
#initialize(next_pipeline_stage, retry_strategy) ⇒ Retry
Returns a new instance of Retry.
8 9 10 11 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/retry.rb', line 8 def initialize(next_pipeline_stage, retry_strategy) @next_pipeline_stage = next_pipeline_stage @retry_strategy = retry_strategy end |
Instance Method Details
#execute_http_request(request_details) ⇒ Object
13 14 15 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/retry.rb', line 13 def execute_http_request(request_details) @retry_strategy.run(-> { @next_pipeline_stage.execute_http_request(request_details) }) end |
#http_response ⇒ Object
17 18 19 |
# File 'lib/elephant_in_the_room/the_one_api_sdk/pipeline/retry.rb', line 17 def http_response @next_pipeline_stage.http_response end |