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

Simplify the debouncer and add tests #512

Merged

Conversation

sungshik
Copy link
Contributor

@sungshik sungshik commented Nov 8, 2024

Before this PR: The debouncer used CompletableFuture.delayedExecutor to schedule futures with a delay. Once scheduled in this way, a delayed future can't be interrupted during the delay. Our use case requires such interruptions, though, so we had a rather complicated workaround.

After this PR: The debouncer uses CompletableFuture.completeOnTimeout to schedule futures with a delay. Once scheduled in this way, a delayed future can be interrupted during the delay, just by using a "normal" completion. The logic to distinguish between a normal completion and a timeout completion is straightforward. Overall, the debouncer has become a lot simpler.

@sungshik sungshik changed the title Simplify the debouncer code Simplify the debouncer Nov 8, 2024
@PieterOlivier
Copy link

This is so much better!

My only concern is with the expensive tests. These tests have a lot of value but they also slow down the CI considerably. We should have a discussion if we want to pay this price on every CI run. Do we run the UI tests on a daily basis? If so we might consider moving these tests to that daily build run instead of in the CI.

@sungshik sungshik marked this pull request as ready for review November 11, 2024 12:14
@sungshik sungshik merged commit 5a123b2 into error-recovery/rascal Nov 11, 2024
4 of 12 checks passed
@sungshik sungshik deleted the error-recovery/rascal-simpler-debouncer branch November 11, 2024 12:15
@sungshik sungshik changed the title Simplify the debouncer Simplify the debouncer and add tests Nov 11, 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