I''ve been using a lot of APIs in my Ruby (usually Rails) applications and I''ve learnt my lesson regarding socket timeouts. Basically, no response (from an API) is better than a slow response. In the cases of slow responses, it''s better to time out so your ActiveResource clients can end execution fast (i.e. fail-fast) instead of blocking (for the default Net::HTTP read_timeout value of 60 seconds) and locking up an entire web server process. So the patches for ActiveResource: * Introduce ActiveResource::Base.timeout to allow Net::HTTP#read_timeout to be set - http://rails.lighthouseapp.com/projects/8994/tickets/5 * ActiveResource::Connection should rescue from Timeout::Error - http://rails.lighthouseapp.com/projects/8994/tickets/6 Please take a look and share any comments/improvements and feel free to point out any flaws and laugh at my code. Cheers, Chu Yeow --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---