When making a ClientEndpoint
API request from an Android app to an App-Engine service, how do I set a deadline/timeout for the execute()
action?
I'm looking for something like:
Foo foo = endpoint.getSomething(id) .setDeadline(2000/*ms*/) .execute();
I am not sure if one can control that. Since the Endpoints are hosted in an App Engine environment, standard timeout for any App Engine HTTP Request should apply i.e. 60 seconds.
When building the endpoint, specify a connect and read timeout in HttpRequestInitializer. For example, in this case 20 and 10 secs respectively.
It is possible. You just need to implement your own HttpRequestInitializer where you set connect and read timeouts in its initialize method. This HttpRequestInitializer need to be passed then as a parameter to your endpoint builder constructor.