Closed grobmeier closed 11 years ago
Yes, absolutely. I'm digging into this.
Thank you! I am available for testing.
@grobmeier I've had this branch lying around for months without getting around to testing it. Are you still available for testing ?
https://github.com/stackp/promisejs/tree/timeout
You can set the timeout value globally (in milliseconds) through the promise.timeout variable (e.g. promise.timeout = 3000;
). The error code associated with a timeout is promise.ETIMEOUT
:
promise.get('/').then(function(error, result) {
if (error === promise.ETIMEOUT) {
console.error("Timeout");
}
});
Cheers
Thats great news! Yes, I will give it a test. It just takes me a while until I have some time to work on my mobile app again as I am currently busy with other things. I will come back to you as early as possible.
AJAX timeout was merged in bdecb2069bdbba, the option is now named promise.ajaxTimeout
.
It would be fantastic if promise.js would support a timeout feature.
In my case (mobile app with phonegap) I sometimes loose connectivity. Therefore it would be great if the request would be finished after a while and an error is thrown (or something like that)