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