Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for App Engine asynchronous URL Fetch #871

Closed
wonderfly opened this issue Jan 10, 2015 · 3 comments
Closed

Support for App Engine asynchronous URL Fetch #871

wonderfly opened this issue Jan 10, 2015 · 3 comments
Assignees
Labels
imported type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@wonderfly
Copy link
Contributor

From [email protected] on April 14, 2014 11:39:44

Java environment: App Engine

This is a feature request to provide support for App Engine's async URL Fetch which is documented here: https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/urlfetch/URLFetchService#fetchAsync(com.google.appengine.api.urlfetch.HTTPRequest) Support needs to be added to the App Engine client to return a Future: https://code.google.com/p/google-http-java-client/source/browse/google-http-client-appengine/src/main/java/com/google/api/client/extensions/appengine/http/UrlFetchRequest.java In addition, the generated libraries need to support handling Future objects.

For example, when using the BigQuery client library: https://developers.google.com/api-client-library/java/apis/bigquery/v2 You would need to be able to do a streaming insert as documented here, in a way which returned a Future: https://developers.google.com/bigquery/streaming-data-into-bigquery The benefit is that you may not have to pay additional frontend instance hours while waiting for a streaming insert to return, if your App Engine code could be doing other work.

Note that there is an HTTPRequest.executeAsync() method available in beta, though it has not been added to the App Engine client: https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#1071

Original issue: http://code.google.com/p/google-api-java-client/issues/detail?id=871

@wonderfly wonderfly added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. imported 2–5 stars labels Jan 10, 2015
@wonderfly wonderfly self-assigned this Jan 10, 2015
@wonderfly
Copy link
Contributor Author

From [email protected] on December 30, 2014 08:25:35

We don't have a plan for adding async support to this library at the moment. I am intending to close this as a low priority feature request, unless there's a strong need in the future.

HttpRequest.executeAsync() is a semi-async implementation, i.e., you have to poll the status of the future, instead of being called back. In terms of App Engine, there isn't a special App Engine client in any way. There's an HttpTransport that's AppEngine specific, but the client you use on AppEngine extends the same AbstractGoogleJsonClient, which has access to HttpRequest.executeAsync(). A small trick is to call AbstractGoogleClientRequest.buildHttpRequest().executeAsync().

Status: WontFix
Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low

@wonderfly
Copy link
Contributor Author

From [email protected] on December 30, 2014 09:56:01

#1 - will calling AbstractGoogleClientRequest.buildHttpRequest().executeAsync() while using the Appengine Transport use appengine's underlying urlfetch.getAsync() or does AbstractGoogleClientRequest.buildHttpRequest().executeAsync() just start a new thread?

@wonderfly
Copy link
Contributor Author

From [email protected] on December 30, 2014 10:52:06

It just starts a new thread and returns a Future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant