Project

General

Profile

Actions

Feature #10176

open

Document how to perform net/http calls in parallel

Added by mperham (Mike Perham) over 9 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:64592]

Description

The typhoeus gem is a big source of Ruby VM crashes. It seems to me that the only reason people use this gem is because net/http doesn't document how to GET many URLs in parallel. I'd like to see a simple code example in the net/http RDoc which show people how to fetch many URLs in parallel using net/http. For example, this might be one way but I don't know if it's the recommended or most efficient way:

urls = %w(www.yahoo.com www.google.com www.bing.com)
results = urls.map { |url| Thread.new { Net::HTTP.get(url, '/') } }.map(&:join)

No data to display

Actions

Also available in: Atom PDF

Like0