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 run() instead of tick() #697

Closed
wants to merge 1 commit into from
Closed

Use run() instead of tick() #697

wants to merge 1 commit into from

Conversation

notgull
Copy link

@notgull notgull commented Mar 30, 2024

run() is more efficiently and spawns a local task queue for efficiency. As opposed to tick(), which only polls the global queue.

run() is more efficiently and spawns a local task queue for efficiency.
As opposed to tick(), which only polls the global queue.

Signed-off-by: John Nunley <[email protected]>
while !executor.is_empty() {
executor.tick().await;
}
executor.run(Empty(&executor)).await
Copy link
Contributor

@zeenix zeenix Mar 30, 2024

Choose a reason for hiding this comment

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

executor running a dummy future, to run itself seems very weird. I understood from your comment here that you intend to make tick also more efficient, so maybe we just wait for that? It all depends on how much efficiency and under which scenarios would it be significant enough to justify sacrificing code readability and many Future impls.

@notgull
Copy link
Author

notgull commented Mar 30, 2024

Good point

@notgull notgull closed this Mar 30, 2024
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