Sha256: 13756d305c7865abd75189b0f8b6f1fc792916898932e023bd7b2a850eb47813

Contents?: true

Size: 478 Bytes

Versions: 14

Compression:

Stored size: 478 Bytes

Contents

$: << '../lib' << 'lib'

require 'eventmachine'
require 'em-http'

EventMachine.run {
  multi = EventMachine::MultiRequest.new

  reqs = [
    'http://google.com/',
    'http://google.ca:81/'
  ]

  reqs.each_with_index do |url, idx|
    http = EventMachine::HttpRequest.new(url, :connect_timeout => 1)
    req = http.get
    multi.add idx, req
  end

  multi.callback  do
    p multi.responses[:callback].size
    p multi.responses[:errback].size
    EventMachine.stop
  end
}

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
em-http-request-samesite-0.1.1 examples/multi.rb
em-http-request-samesite-1.1.7 examples/multi.rb
em-http-request-1.1.7 examples/multi.rb
em-http-request-1.1.6 examples/multi.rb
em-http-request-1.1.5 examples/multi.rb
em-http-request-1.1.4 examples/multi.rb
em-http-request-1.1.3 examples/multi.rb
em-http-request-1.1.2 examples/multi.rb
em-http-request-1.1.1 examples/multi.rb
em-http-request-1.1.0 examples/multi.rb
em-http-request-1.0.3 examples/multi.rb
em-http-request-1.0.2 examples/multi.rb
em-http-request-1.0.1 examples/multi.rb
em-http-request-1.0.0 examples/multi.rb