Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async support for request method #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

patacoing
Copy link

We added an async support for the request method from the class QGConnector
method by creating an async_request method.
The async_request provides the same arguments as the other one.
In order to support async calls, we used the aiohttp module. We didn't change the way the method works but just changed sync calls by async calls. It concerns api calls and sleep.

We didn't use the normal syntax of context managers because it would have been problematic because of different try...excepts in the method. Instead of this, we used the aenter() and aexit() dunder methods.

This Pull request makes sense if we have to perform several api calls. Instead of waiting each one to be finished, we can use the advantage of concurrency to speed those up.

We added an async support for the request
method by creating an async_request method.
It provides the same arguments as the other one.
In order to support async calls, we used the aiohttp module.
We didn't change the way the method works but just changed sync calls
by async calls. It concerns api calls and sleep.
@patacoing patacoing marked this pull request as draft August 23, 2024 16:13
Added missing ssl verification.
Convert data to be FormData.
Added auth by using BasicAuth.
@patacoing patacoing marked this pull request as ready for review August 26, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants