Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This is the continuation or PR #218)
This commit introduces the asynchronous Pyxis GQL module. It will hopefully allow for a better performance when interfacing with the Pyxis GQL endpoint.
The changes include:
Most of the code is reused from the synchronous Pyxis GQL module.
Caching (dogpile)
While trying to use dogpile (which is used by the sync module for caching), I kept running into this error:
RuntimeError: cannot reuse already awaited coroutine
.It seems that, unfortunately, dogpile still does not support async functions:
sqlalchemy/dogpile.cache#200
sqlalchemy/dogpile.cache#199
I guess we can try another module for caching the async functions in the future, for example https://github.com/aio-libs/aiocache. I didn't implement caching for now.
Testing
I believe tox is failing due to things ouside the scope of this PR. But all tests passed in my local machine, I swear! xD
I made manual tests for the new module to make sure things are working fine. I didn't include them in the final contribution, though.
Documentation
And here is the zippe documentation again, in case you want to check it out:
docs.zip
Question
PyxisGQL.find_images_by_name_version
, in the sync module, is outdated. I fixed it in the async version, do you want me to update the sync version as well?Thanks again for your time, and sorry for the big PR! 😁
JIRA: [CWFHEALTH-2039]