我正在开发一个基于 GAE 和 python 2.7.13 的应用程序。我想要做的是在处理程序中进行一堆异步 API 调用。类似的东西:
class MakeRequests(webapp2.RequestHandler):
def post(self, *v, **kv):
*do an async api call#1*
*do an async api call#2*
*do an async api call#3*
*wait for response from all of above api requests*
*make response in a way like if call#1 failes, make it's expected*
*attributes in response as None, if call#2 succeeds add it's*
*attributes in response etc. This is just an example.*
为此,我已经试过像图书馆asyncio,grequests,requests和simple-requests,他们不似乎是工作,因为无论他们是不兼容GAE或python 2.7.13。有人能帮我一下吗?
慕哥9229398
相关分类