sreelal / google-api-objectivec-client

Automatically exported from code.google.com/p/google-api-objectivec-client
0 stars 0 forks source link

Need timeoutInterval setter of GTLService #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes Google services just do not respond, and the default 60 
timeoutInterval is too long a wait in vain. It is better if we can set 
timeoutInterval that we see proper in our apps.

Original issue reported on code.google.com by an0...@gmail.com on 10 May 2012 at 4:40

GoogleCodeExporter commented 9 years ago
And because of this forced minimum 240-second timeout problem on 
iOS(https://devforums.apple.com/message/108087#108087, 
http://stackoverflow.com/questions/2736967/nsmutableurlrequest-not-obeying-my-ti
meoutinterval), can we implement our own timeout with NSTimer and 
NSURLConnection's cancel method?

Thanks.

Original comment by an0...@gmail.com on 10 May 2012 at 5:20

GoogleCodeExporter commented 9 years ago
You can set a timer and call cancelTicket: to implement your own timeout.

Original comment by grobb...@google.com on 10 May 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Yes. But one more thing we offer in the framework, one less thing thousands of 
devs need to do.

Original comment by an0...@gmail.com on 10 May 2012 at 6:37

GoogleCodeExporter commented 9 years ago
I don't think most apps should be setting a timeout at all. Users should be the 
ones to cancel requests. If the user isn't waiting on the fetch, there's no 
need for it to timeout.

Original comment by grobb...@google.com on 10 May 2012 at 8:05

GoogleCodeExporter commented 9 years ago
If I setup my own timeout with NSTimer and cancelTicket:, I have to duplicate 
timeout handling code in two places: one in the query's completionHandler, one 
in my timeout callback.

If GTLService setups the timeout, it should naturally return the timeout as an 
error in the query's completionHandler, just as the real NSURLConnection 
timeout, then I only need to simply handle that in the completionHandler.

Original comment by an0...@gmail.com on 12 May 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Unless additional developers indicate a need for this functionality, I do not 
expect it to be incorporated into the library.

Original comment by grobb...@google.com on 17 May 2012 at 1:56