Hi Tony --
Let's say I don't need threads to issue requests through the same connection, and I'm ok with each thread creating a brand new connection. Is it thread-safe in that case? e.g. can I just do
urls.each do |url|
Thread.new do
responses[url] = HTTP.get(url)
end
end
so that each of the urls are fetched in parallel?
(This is just an example - in reality I want to make asynchronous http requests in a more ad hoc way, rather than all at the same time).
I'm surprised the documentation doesn't mention anything about thread-safety, as it's quite difficult to find any thread-safe HTTP client in Ruby.
Also, I noticed that the timeout feature uses Ruby's Timeout, which I've heard is not thread-safe (or safe at all).
Thanks!
Jon