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

Use more async and allow parallel downloads #21

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

themadprofessor
Copy link
Contributor

No description provided.

@auyer auyer added the 🚀 Feature New feature or request label Mar 17, 2024
@auyer
Copy link
Owner

auyer commented Mar 17, 2024

Hi! Thank you for your contribution. First of all, the parallel download is really nice.

However there are a few thing we need to check.

  1. In my tests, the validation of the latest Proton version failed a couple times, and was successful right after. Not sure what caused this behavior. Adding a test case for this would be very interesting.
    image
  2. Aren't we overusing async ? There are a few branches that I see no advantage in being async. For instance, the detect_installations and check_if_exists functions. They are two filesystem related functions that are both simple and fast. Making them non-blocking wont make the app any faster. And when they are called, nothing else is happening in the software.

Please, tell me what you think. Thanks.

@themadprofessor
Copy link
Contributor Author

That should be the validation fixed.

In general, calling blocking calls within async blocks is not a good idea since it can block multiple futures from progressing. The blocking calls might be fast, but they could be slow. Using the non-blocking versions might not make it any faster, but it is more correct and would prevent a single slow I/O from blocking progress.

Copy link
Owner

@auyer auyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good now, and it works vary well!
I could not reproduce the error anymore. I think you nailed it.
Thanks!

@auyer auyer merged commit 0e5035e into auyer:main Apr 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants