-
Notifications
You must be signed in to change notification settings - Fork 1
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
Error messages when calling Client in async environment OR locking #33
Comments
Ciao @KonnikPahoni Please excuse my late reply. Do you have some code to replicate this issue? |
Any code (async-await or threading) that would call the same instance of the client. Because the client has a state which contains information about the ongoing request. Should be one at a time. We are still using the client, just creating a new instance on every request. |
Okay if you are working in an async environment, i recommend using qlient-aiohttp. it is still in beta but i am planing on releasing a stable version soon. I will have a look at the problem in the meantime. Thank you for pointing it out |
Kudos for your work, it is the only client I found that allows interacting with GraphQL using native Python types! |
Story
I am using this beautiful client in the last months and today I found a bug in our system. This costed me and our partners a lot of time and efforts. We were chasing this bug for two months.
I was creating a single Client instance for the app, which is a usual practice. Then I was calling the instance of Client first with threads, then in asynchronous environment. For two months. At the end it appeared that the problem is related to using qlient.
Problem
Users expect the Client to either implement locking mechanism, or to disallow calling Client from async environment.
Solution
Raise errors when calling Client instance from async environment.
The text was updated successfully, but these errors were encountered: