Class: Faraday::Request::Retry::Options
- Defined in:
- lib/faraday/request/retry.rb
Constant Summary collapse
- DEFAULT_CHECK =
lambda { |env,exception| false }
Class Method Summary collapse
Instance Method Summary collapse
- #backoff_factor ⇒ Object
- #exceptions ⇒ Object
- #interval ⇒ Object
- #interval_randomness ⇒ Object
- #max ⇒ Object
- #max_interval ⇒ Object
- #methods ⇒ Object
- #retry_if ⇒ Object
Class Method Details
.from(value) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/faraday/request/retry.rb', line 29 def self.from(value) if Fixnum === value new(value) else super(value) end end |
Instance Method Details
#backoff_factor ⇒ Object
53 54 55 |
# File 'lib/faraday/request/retry.rb', line 53 def backoff_factor (self[:backoff_factor] ||= 1).to_f end |
#exceptions ⇒ Object
57 58 59 60 |
# File 'lib/faraday/request/retry.rb', line 57 def exceptions Array(self[:exceptions] ||= [Errno::ETIMEDOUT, 'Timeout::Error', Error::TimeoutError]) end |
#interval ⇒ Object
41 42 43 |
# File 'lib/faraday/request/retry.rb', line 41 def interval (self[:interval] ||= 0).to_f end |
#interval_randomness ⇒ Object
49 50 51 |
# File 'lib/faraday/request/retry.rb', line 49 def interval_randomness (self[:interval_randomness] ||= 0).to_f end |
#max ⇒ Object
37 38 39 |
# File 'lib/faraday/request/retry.rb', line 37 def max (self[:max] ||= 2).to_i end |
#max_interval ⇒ Object
45 46 47 |
# File 'lib/faraday/request/retry.rb', line 45 def max_interval (self[:max_interval] ||= Float::MAX).to_f end |
#methods ⇒ Object
62 63 64 |
# File 'lib/faraday/request/retry.rb', line 62 def methods Array(self[:methods] ||= IDEMPOTENT_METHODS) end |
#retry_if ⇒ Object
66 67 68 |
# File 'lib/faraday/request/retry.rb', line 66 def retry_if self[:retry_if] ||= DEFAULT_CHECK end |