Module: HTTPX::Plugins::Retries::RequestMethods
- Defined in:
- lib/httpx/plugins/retries.rb
Instance Attribute Summary collapse
-
#partial_response ⇒ Object
writeonly
a response partially received before.
-
#retries ⇒ Object
number of retries left.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Object
initializes the request instance, sets the number of retries for the request.
- #response=(response) ⇒ Object
Instance Attribute Details
#partial_response=(value) ⇒ Object (writeonly)
a response partially received before.
237 238 239 |
# File 'lib/httpx/plugins/retries.rb', line 237 def partial_response=(value) @partial_response = value end |
#retries ⇒ Object
number of retries left.
234 235 236 |
# File 'lib/httpx/plugins/retries.rb', line 234 def retries @retries end |
Instance Method Details
#initialize(*args) ⇒ Object
initializes the request instance, sets the number of retries for the request.
240 241 242 243 |
# File 'lib/httpx/plugins/retries.rb', line 240 def initialize(*args) super @retries = .max_retries end |
#response=(response) ⇒ Object
245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/httpx/plugins/retries.rb', line 245 def response=(response) if @partial_response if response.is_a?(Response) && response.status == 206 response.from_partial_response(@partial_response) else @partial_response.close end @partial_response = nil end super end |