Skip to content

Instantly share code, notes, and snippets.

@fxposter
Created October 28, 2015 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fxposter/cd4bd30e06de1478e6ba to your computer and use it in GitHub Desktop.
Save fxposter/cd4bd30e06de1478e6ba to your computer and use it in GitHub Desktop.
Net/HTTP with keep-alive, but without block
http = Net::HTTP.new(uri.host, uri.port)
http.start
request1 = Net::HTTP::Get.new(uri1)
response1 = http.request(request1)
request2 = Net::HTTP::Get.new(uri2)
response2 = http.request(request2)
http.finish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment