GitHub user carlosduclos opened an issue:

    https://github.com/apache/couchdb-nano/issues/18

    define a configurable default timeout for all request, and provide timeouts 
for specific requests

    [Original issue](https://github.com/dscape/nano/issues/305)
    
    __osher__
    Hi,
    I was looking for a way to provide timeouts to specific calls, and/or 
default timeout for all requests.
    
    I concluded that there is no such thing, because searching for "timeout" in 
nano.js yields nothing (where I expected some entries - at least in the relax 
function...)
    
    Personally I think that's something that should be facilitated by such a 
good infrastructure.
    
    If I'm just misreading the picture - I'd be delighted to be directed to how 
it's done.
    
    If in deed it's not implemented - then - If it fits the spirit here - would 
you like a PR to add such functionality?
    
    What I propose to do is:
    1 - add handling of options.timeout in the relax function
    2 - replace access to the higher relax to calls from all methods of 
doc-scope to calls to an enclosed relax - one that works with the dbName of the 
"docScope" - and db.timeout.
    3 - expose the enclosed relax on docScope so it can be used with the 
defaults enclosed for it
    4 - have the enclosed db.relax uses db.timeout as timeout to pass to higher 
relax
    
    mmm - I'm not sure what would be more useful: if timeout should compare 
against begining of accepting content from the server, or a "brutal" timeout - 
i.e - compares against completion of response...
    let me know what you think. We can implement both, however, the 2nd is 
simpler.
    
    Thoughts?
    
    __satazor__
    I think you can specify the default timeout with requestDefaults, not sure 
about specifying a timeout for each request.

----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to