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

Backend: DelayedRun sync #746

Merged
merged 6 commits into from
Jan 20, 2024
Merged

Conversation

Thunderblade73
Copy link
Contributor

Found a better sync bug fix.

@hannibal002 hannibal002 self-requested a review November 30, 2023 16:13
@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

# Conflicts:
#	src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
Copy link

github-actions bot commented Dec 8, 2023

Conflicts have been resolved! 🎉

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Dec 8, 2023
@jani270 jani270 modified the milestones: Version 0.22, Version 0.23 Dec 14, 2023
@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Jan 11, 2024
Copy link

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Jan 13, 2024
Copy link

Conflicts have been resolved! 🎉

Copy link
Owner

@hannibal002 hannibal002 left a comment

Choose a reason for hiding this comment

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

The logic looks fancy, thanks <3
Not sure if im missing something but one small thing here looks misleading or wrong to me

@hannibal002 hannibal002 added the Soon This Pull Request will be merged within the next couple of betas label Jan 20, 2024
@Thunderblade73
Copy link
Contributor Author

Since both suggestion are for one and the same issue:
It's 1 tick must happend but up to 1 extra tick could have happend.
I wanted to have this behavior so it is guaranteed that one tick has parsed, without that we would always execute the runNextTick in the subTick before the next Tick which is misleading.
And also some stupid stuff could happen without that:
Say you run a runNextTick in a LorenzTickEvent. Then it could be possible that the code executes immediately after that event Listener finishes since the next Listener could be the checkRuns one and therefore no time has parsed for it.

@hannibal002
Copy link
Owner

The idea behind "run in next tick" for me was not a "provide at least 50ms delay" but rather "run in the next tick in the main thread".
But your logic is better.
Now the function executes in between 50 and 100 ms, instead of 1 and 50 ms. this feels more consistent.
And the extra 50ms will hurt no one.

Now only one question remains to me: should we rename the function runNextTick to something else?

@Thunderblade73
Copy link
Contributor Author

The name is fine. Also documented the behavior.

@hannibal002 hannibal002 merged commit dd86bba into hannibal002:beta Jan 20, 2024
3 checks passed
@github-actions github-actions bot removed the Soon This Pull Request will be merged within the next couple of betas label Jan 20, 2024
@Thunderblade73 Thunderblade73 deleted the Delayed-Run branch January 20, 2024 12: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.

3 participants