From: Pat Maddox Date: 2007-06-15T17:26:45+09:00 Subject: Re: How to set the timeout attr when using open-uri to open a url. On 6/15/07, sishen wrote: > I met a problem using open-uri. > > I want to set the timeout of the open process. And i see the open method has > a option named "read_timeout". > So i just code as > open("www.abc.com", {:read_timeout => 10}). > > But, i can't see the effect. What's wrong with that? Any help thanks. > You can use the timeout library. timeout(10) do open "www.abc.com" end it raises a TimeoutError if the request doesn't complete in 10 seconds. Pat