diff options
author | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-05-07 13:34:52 +0800 |
---|---|---|
committer | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-05-07 13:34:52 +0800 |
commit | aca44bcd92ef783abdf484b58abdde6786db0f89 (patch) | |
tree | 506fe113f46029f0ee3e5cb4a6fed9d378c72a2d /activeresource | |
parent | 963d7caeeec0288803e83557cc890047e35ea801 (diff) | |
download | rails-aca44bcd92ef783abdf484b58abdde6786db0f89.tar.gz rails-aca44bcd92ef783abdf484b58abdde6786db0f89.tar.bz2 rails-aca44bcd92ef783abdf484b58abdde6786db0f89.zip |
Make a note about ActiveResource::Timeouterror being raised when ARes calls timeout.
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 570732e236..9859b6dcd2 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -183,12 +183,15 @@ module ActiveResource # self.timeout = 5 # end # - # This sets the +timeout+ to 5 seconds. You can adjust the timeout to a value suitable for the RESTful API + # This sets the +timeout+ to 5 seconds. You can adjust the +timeout+ to a value suitable for the RESTful API # you are accessing. It is recommended to set this to a reasonably low value to allow your Active Resource # clients (especially if you are using Active Resource in a Rails application) to fail-fast (see # http://en.wikipedia.org/wiki/Fail-fast) rather than cause cascading failures that could incapacitate your # server. # + # When a timeout occurs, an ActiveResource::TimeoutError is raised. You should rescue from + # ActiveResource::TimeoutError in your Active Resource method calls. + # # Internally, Active Resource relies on Ruby's Net::HTTP library to make HTTP requests. Setting +timeout+ # sets the <tt>read_timeout</tt> of the internal Net::HTTP instance to the same value. The default # <tt>read_timeout</tt> is 60 seconds on most Ruby implementations. |