Sha256: 0f8125abea872849231daac72f9bf55e30cdd67c9158f93651335839a35b12ae

Contents?: true

Size: 377 Bytes

Versions: 154

Compression:

Stored size: 377 Bytes

Contents

$:.unshift(File.join('..', 'lib'))
require 'httpclient'

urlstr = ARGV.shift

proxy = ENV['HTTP_PROXY'] || ENV['http_proxy']
h = HTTPClient.new(proxy)

count = 20

res = []
g = []
for i in 0..count
  g << Thread.new {
    res[i] = h.get(urlstr)
  }
end

g.each do |th|
  th.join
end

for i in 0..(count - 1)
  raise unless (res[i].content == res[i + 1].content)
end

puts 'ok'

Version data entries

154 entries across 146 versions & 13 rubygems

Version Path
httpclient-2.5.3.1 sample/thread.rb
httpclient-2.5.3 sample/thread.rb
httpclient-2.5.2 sample/thread.rb
httpclient-2.5.1 sample/thread.rb
scout-5.9.7.2.pre vendor/httpclient/sample/thread.rb
httpclient-2.5.0 sample/thread.rb
scout-5.9.8.pre vendor/httpclient/sample/thread.rb
scout-5.9.7.1 vendor/httpclient/sample/thread.rb
glebtv-httpclient-3.2.8 sample/thread.rb
scout-5.9.7.pre vendor/httpclient/sample/thread.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/httpclient-2.4.0/sample/thread.rb
scout-5.9.5 vendor/httpclient/sample/thread.rb
scout-5.9.4 vendor/httpclient/sample/thread.rb
scout-5.9.4.pre vendor/httpclient/sample/thread.rb
httpclient-2.4.0 sample/thread.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/httpclient-2.3.4.1/sample/thread.rb
scout-5.9.3 vendor/httpclient/sample/thread.rb
glebtv-httpclient-3.2.7 sample/thread.rb
glebtv-httpclient-3.2.6 sample/thread.rb
glebtv-httpclient-3.2.4 sample/thread.rb