Description
Related to issue#1187.
- Workaround implemented in PR#1369 that allows users who use frameworks that don't wrap their requests in a running "
ProactorEventLoop
" to pass in python's built-inrequests
module asQnAMaker._http_client
.
Filing an issue per email conversation with Axel and Dave T.:
so that we follow the pattern that’s closer to what’s happening in LUIS:
• If they pass in an http client on init, then use that
• Otherwise instead of creating the aiohttp.ClientSession instance in the ctor like we do currently (which is not a coroutine), we should do it in the HttpRequestUtils.execute_http_request method (where it is async), where we make the actual POST request to QnA service
And I think with that, this should remove the need for Quart projects to have to pass in http_client too.
The above should allow more python frameworks to continue using aiohttp
to make requests, which is asynchronous, instead of being forced to use synchronous requests
module.