Speeding Up Net::HTTP, OpenURI or Any Other TCPSocket Offspring
Only if you’re doing lots of requests amongst threads and you notice that the opening of the socket is blocking everything.
And if you are, then it’s the Matz’ pajamas.
I’m sorry if you feel offended, it’s not my intention. But if getaddrinfo() on your system does not work as you expect, I’m not the right person to report. The only workaround I can think of is to use “resolv-replace”, which is pure Ruby resolver. It is not fast at all, but at least other thread can work during resolving.
For an example, see Josh Harvey’s code.