Skip to content

Asynchronous Python Playground #22

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

Closed
wants to merge 13 commits into from

Conversation

Nibba2018
Copy link
Contributor

@Nibba2018 Nibba2018 commented Oct 2, 2020

Hi @eldadfux , I tried a workaround to run python playground asynchronously. Do have a look.
This PR refers to this issue

API Calls

  • Create Collection
  • List Collection
  • Add Document
  • List Document
  • Upload File
  • Create User
  • List User

@eldadfux
Copy link
Member

eldadfux commented Oct 3, 2020

@Nibba2018 do you think this PR will make a better default example than the synced version?

@Nibba2018
Copy link
Contributor Author

@eldadfux , I did some tests and found that this takes the same amount of time to execute compared to the synced version. So I am still a bit doubtful whether this is truly asynchronous. I think we have to implement __await__() for sdk classes to get better results. I am currently creating a detailed issue on sdk-generator.

@Niraj-Kamdar
Copy link

This won't work because there isn't any awaitable coroutine in your asynchronous functions. This will just run synchronously and will take more time then synchronous counterpart due to the additional overhead of the event loop. You have two options to make it asynchronous either by running it in another thread by using run_in_executor or make the underlying library asynchronous. The first one is easy.

@Nibba2018
Copy link
Contributor Author

@Niraj-Kamdar , Okay let me try this.

@eldadfux eldadfux added the hacktoberfest-accepted Accepted for Hacktoberfest, will be merged later label Oct 31, 2020
@eldadfux eldadfux closed this May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted for Hacktoberfest, will be merged later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants