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

[thread_executor] Fix thread sleep in work loop #73

Merged
merged 1 commit into from
Jul 2, 2023

Conversation

JohnMurray
Copy link
Owner

Summary

Fix the loop in the thread executor to only sleep when no work has been done on an iteration. Because only one message per actor is processed per loop (for fairness or whatever), it's very possible/likely for there to be more message waiting. In those instances, we don't need to sleep.

Motivation

Found this issue while working on #29. We shouldn't sleep when there is still work to be done (potentially). Even though the thread-executor will eventually be replaced with a tokio runtime, should still fix this up.

Test Plan

Existing examples thoroughly exercise this.

@JohnMurray JohnMurray self-assigned this Jul 2, 2023
@JohnMurray JohnMurray added this to the 0.3.0 milestone Jul 2, 2023
@JohnMurray JohnMurray changed the title fix [thread_executor] Fix thread sleep in work loop Jul 2, 2023
@JohnMurray JohnMurray merged commit 6c44774 into main Jul 2, 2023
4 checks passed
@JohnMurray JohnMurray deleted the executor/fix-thread-sleep branch July 2, 2023 19:12
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.

None yet

1 participant