Торнадо блокирует другой запрос или ioloop - PullRequest
1 голос
/ 05 июля 2019

Проблема: Почему я не могу позвонить другим, запрос

enter image description here

Цель: Хотел позвонить в другие сервисы, даже если предыдущий еще работает

enter image description here

Я уже пробовал это торнадо-блокировка-асинхронные запросы , но все равно блокирует другой запрос

Главный обработчик

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)

Я не хочу вызывать другой запрос, пока остальные 10 запросов еще обрабатываются. Но почему другой может обрабатывать новый запрос, пока другой находится в процессе? Слишком много для обработки одновременных 10 запросов?

https://i.imgur.com/yVR8eNw.png

Что может быть причиной этого?

...