Let's say I have the following code in Google App Engine:
from urllib import urlopen
...
data1 = urlopen(url2).read()
data2 = urlopen(url2).read()
...
To improve the latency, I would like to run these two requests to external URLs asynchronously. How can I do that? I know how to do it in normal Python using a thread pool, but Google App Engine does not seem to support multiple threads.
Did you read the docs? https://developers.google.com/appengine/docs/python/urlfetch/asynchronousrequests
you should use ndb tasklets.
https://developers.google.com/appengine/docs/python/ndb/async#urlfetch