Method: Excon::Connection#requests
- Defined in:
- lib/excon/connection.rb
#requests(pipeline_params) ⇒ Object
Sends the supplied requests to the destination host using pipelining.
@pipeline_params [Array<Hash>] pipeline_params An array of one or more optional params, override defaults set in Connection.new, see #request for details
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/excon/connection.rb', line 280 def requests(pipeline_params) pipeline_params.each {|params| params.merge!(:pipeline => true, :persistent => true) } pipeline_params.last.merge!(:persistent => @data[:persistent]) responses = pipeline_params.map do |params| request(params) end.map do |datum| Excon::Response.new(response(datum)[:response]) end if @data[:persistent] if key = responses.last[:headers].keys.detect {|k| k.casecmp('Connection') == 0 } if responses.last[:headers][key].casecmp('close') == 0 reset end end else reset end responses end |