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

Suggested changes (code untested) to tutorial. #46

Open
wants to merge 3 commits into
base: async_docs
Choose a base branch
from

Conversation

alexaryn
Copy link

No description provided.


## Wait for all tasks to finish
for i, task_id in enumerate(task_ids):
while True:
file_to_result = {}
Copy link
Contributor

@AbhijitP-009 AbhijitP-009 Feb 11, 2025

Choose a reason for hiding this comment

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

It took me reading this loop 3 times to understand why this might be more performant. I guess now we're circling through each of the tasks more frequently so we might increase our chances of "catching" one that's completed and adding its result into the completed list earlier. Although I'm unconvinced that "catching" a completed task earlier and adding its results to the results map earlier is really going to be much more performant, unless I'm missing something.

Also, I'm not convinced that a more efficient code is preferred to easier to understand code in a tutorial.

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

Successfully merging this pull request may close these issues.

2 participants