Problem: Why can't I call others request
Goal: Wanted to call other services even if the previous one is still on process
I already tried this tornado-blocking-asynchronous-requests but still blocks the other request
Main handler
class Main(APIUserAuth):
@gen.coroutine
def post(self):
hotelId=self.get_argument('code',False)
try:
if not hotelId:
raise Error('Hotel ID is not defined')
params=escape.json_decode(self.request.body)
result=yield Hotel.pricing(hotelId,params)
self.write(result)
except Error as e:
self.write_wrong(str(e))
except Exception as e:
print(traceback.format_exc())
self.write_wrong()
finally:
self.finish()
Hotel.py
@coroutine
def pricing(hotelId,request):
params=parseParam(request)
http_client=AsyncHTTPClient()
url=URL+'/price'
request=tornado.httpclient.HTTPRequest(url=url, method='POST',headers=HEADERS, body=json.dumps(params), connect_timeout=500, request_timeout=500)
response= yield tornado.gen.Task(http_client.fetch, request)
raise Return(response.body)
I wan't to call other request while the other 10 request are still on process. But why is that the other can still process the new request while the other is on process? Is having simultaneous 10 requests is too much to handle?
What might be the cause of this?