Skip to content

Instantly share code, notes, and snippets.

@fdocr
Created April 20, 2022 22:24
Show Gist options
  • Save fdocr/ea58995b6b333eb0ac4857bb000a6881 to your computer and use it in GitHub Desktop.
Save fdocr/ea58995b6b333eb0ac4857bb000a6881 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'httparty'
url = 'https://google.com'
concurrency = 15
threads = []
concurrency.times do |i|
threads << Thread.new do
response = HTTParty.get(url)
p "Request #{i}: #{response.code}"
end
end
threads.each(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment