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

Are Python SDK API calls truly Asynchronous? #65

Closed
Nibba2018 opened this issue Oct 3, 2020 · 1 comment
Closed

Are Python SDK API calls truly Asynchronous? #65

Nibba2018 opened this issue Oct 3, 2020 · 1 comment

Comments

@Nibba2018
Copy link

While using the following syntax to call appwrite's methods:

async def create_collection():
    database = Database(client)
    print("Running Create Collection API")
    response = await database.create_collection(...)
    collectionId = response['$id']
    print(response)

leads to the following error:
object dict can't be used in 'await' expression

After some googling I found that the sdk class needs to implement __await__() dunder function to make it awaitable and hence asynchronous.

I also tried a different implementation here by removing await before the sdk method call.
After running some tests I found that the execution time and order of execution were similar to that of the synchronous one. So I am not really sure if its truly asynchronous. Any thoughts regarding this issue? or am I doing something wrong?

@TorstenDittmann
Copy link
Contributor

Closing this in favor of appwrite/sdk-for-python#26

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2023
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

No branches or pull requests

3 participants