-
Notifications
You must be signed in to change notification settings - Fork 2
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
loading spinner #232
loading spinner #232
Conversation
GUI/src/main/kotlin/ui/components/selectVideoScreen/ComputeDifferencesButton.kt
Outdated
Show resolved
Hide resolved
generating differences is sadly not cancelable, job.cancel does not work. |
What do we do with this then? @a-miscellaneous @AlperK61 |
next sprint, conflicts left |
We have to make the difference generation cooperative for cancelling. Then, |
After doing my research, it is pretty clear, that we can only cancel the job by injecting some kind of suspend function into the |
Signed-off-by: AlperK61 <[email protected]>
Signed-off-by: AlperK61 <[email protected]>
Signed-off-by: AlperK61 <[email protected]>
This introduces a singleton that can be used to signal the premature cancellation of a running algorithm. The algorithm checks if it is still alive regularly while the user can signal from the outside that the algorithm should finish itself. This is similar to how one would cancel a coroutine in compose (with `yield`), but we wanted to avoid having kotlinx as a dependency for lib2. Signed-off-by: Anton Kriese <[email protected]>
Catches the exception thrown by a cancelled algorithm, to not switch to the DiffScreen after the computation. This change leads to the algorithm actually being cancelled instead of silently run in the background like previously. Signed-off-by: Anton Kriese <[email protected]>
Signed-off-by: Anton Kriese <[email protected]>
8ddcfe7
to
4e7c96f
Compare
Rebased onto main and added singleton to cancel running algorithm instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and seems to work nicely. I only request restyling the AlertDialog to match our new style
Signed-off-by: zino212 <[email protected]>
closes #208