danwrong / restler

REST client library for node.js
MIT License
1.99k stars 391 forks source link

should the timeout listener fire when there is no connection at all? #189

Open michahell opened 9 years ago

michahell commented 9 years ago

should

var rest = require('restler');
...
rest.get(someRequest, {timeout: someTimeout}).on('timeout', function() {
        ...
        // show modal expressing timeout f.e.
        ...
})

work also in the case when there is no connection to begin with? So, before the request is fired at all? as far as i understand this is not the case at the moment. Is this a responsibility of application logic (i.e. i should detect this myself, before even allowing to fire a request) or is this something nice to incorporate into restler?

parisholley commented 9 years ago

i've had issues where timeouts aren't triggered, I assume it may be related to this. for now, just going to wrap my call with setTimeout()