mwunsch / weary

A framework and DSL for building RESTful web service clients
MIT License
480 stars 23 forks source link

Timeout setting #17

Closed mariochavez closed 12 years ago

mariochavez commented 12 years ago

Hi;

Working on an API I did noticed that time to time it does timeout, I have found that if I increase the timeout value for the http request a bit, I can avoid more of the timeouts errors.

I'm willing to to add this functionality, but I'm wondering how to add it.

My first thought is to add a new command like timeout that we can use in weary client and set value there, like:

class MyAPI < Weary::Client
   domain http://url.com
   timeout 1000

   methods ....
end

So please let me know if this work's for you.

mwunsch commented 12 years ago

I think it might make more sense to put it on the Request object.

request.timeout 1000

mwunsch commented 12 years ago

Hi! I'm back. @mariochavez, would something like: https://github.com/kch/rack-timeout be a good solution here? Utilizing the full Rack-itude of Weary?