我正在開發一個基于 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。有人能幫我一下嗎?
如何在 GAE 應用程序中執行異步 api 請求?
慕婉清6462132
2021-09-14 10:37:38