Class: Html2rss::RequestService::FaradayStrategy
- Defined in:
- lib/html2rss/request_service/faraday_strategy.rb
Overview
Strategy to use Faraday for the request.
Defined Under Namespace
Classes: StreamingBodyMiddleware
Instance Attribute Summary collapse
- #response_guard ⇒ ResponseGuard readonly
Instance Method Summary collapse
-
#perform_execute ⇒ Response
Executes the request with runtime policy enforcement, returning the normalized response.
Methods inherited from Strategy
Constructor Details
This class inherits a constructor from Html2rss::RequestService::Strategy
Instance Attribute Details
#response_guard ⇒ ResponseGuard (readonly)
31 32 33 |
# File 'lib/html2rss/request_service/faraday_strategy.rb', line 31 def response_guard @response_guard end |
Instance Method Details
#perform_execute ⇒ Response
Executes the request with runtime policy enforcement, returning the normalized response.
36 37 38 39 40 41 42 |
# File 'lib/html2rss/request_service/faraday_strategy.rb', line 36 def perform_execute deadline = request_deadline @response_guard = ResponseGuard.new(policy: ctx.policy) raw_response = faraday_request(response_guard, deadline:, streaming_buffer: true) raw_response = retry_without_streaming(response_guard, deadline:) if retry_without_streaming?(raw_response) build_response(raw_response) end |