Method: HTTP::Chainable#timeout
- Defined in:
- lib/http/chainable.rb
#timeout(options = {}) ⇒ HTTP::Session #timeout(global_timeout) ⇒ HTTP::Session
Set timeout on the request
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/http/chainable.rb', line 53 def timeout() klass, = case when Numeric then [HTTP::Timeout::Global, { global_timeout: }] when Hash then resolve_timeout_hash() when :null then [HTTP::Timeout::Null, {}] else raise ArgumentError, "Use `.timeout(:null)`, " \ "`.timeout(global_timeout_in_seconds)` or " \ "`.timeout(connect: x, write: y, read: z)`." end branch .merge( timeout_class: klass, timeout_options: ) end |