Class: ElephantInTheRoom::TheOneApiSdk::Pipeline::Retry

Inherits:
Object
  • Object
show all
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

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_responseObject



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