-
Couldn't load subscription status.
- Fork 1
Async http client #8
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
Conversation
|
Currently all requests urls are logged into console. This is not intended functionality and I will have to find a way to disable that. |
|
|
||
| response = None | ||
|
|
||
| for retry_attempt in range(self.retries + 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not needed and the retry can be handled by the same logic as in the normal client using httpx.Retry and by starting the client(session) with retry parameter see example here
|
|
||
| jobs = generate_jobs(1000) | ||
|
|
||
| results = await client.process_multiple(jobs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to achieve this without having the main_async function async? E.g. something like this My idea was to have a function, that would run and wait for multiple jobs and just returned all the results (with the disadvantage of having to store all results in memory). Then I would just call something like results = client.run_multiple_sync() in my sync function. Is that possible?
Also I somehow dislike the name process_multiple what does it do? It actually sends multiple requests (not jobs) and returns list of result futures right? The request is basically the parameters of _request_raw http.py equivalent. I think it should be named something like run_multiple_requests(). Also I can imagine having equivalent for each method, e.g. post_multiple
|
Closing this PR in favor of #9 |
Things to discuss:
I do not know if I need to change anything in .github/workflows.
TODO:
@davidesner @bakobako