-
Notifications
You must be signed in to change notification settings - Fork 27
Feat(dui3) Debouncing progress updates #106
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #106 +/- ##
========================================
- Coverage 8.24% 8.21% -0.04%
========================================
Files 230 231 +1
Lines 4367 4383 +16
Branches 505 508 +3
========================================
Hits 360 360
- Misses 3997 4013 +16
Partials 10 10 ☔ View full report in Codecov by Sentry. |
/// Debouncing progress for every %1 update for UI. | ||
/// This class requires a specific bridge in its binding, so registering it will create random bridge which we don't want to. | ||
/// </summary> | ||
public class OperationProgressManager |
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.
I would make this class a singleton and inject it on usage. The Bridge isn't needed until set is called so doesn't need to be on the constructor.
How does it know it's done? Does the diff only care if it's changed, not if it's greater?
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.
that's a good point
* uses time instead of progress values * adds status as a change detector
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.
Smells better
My initial attempt was on Timers, but I had random behaviors on Autocad, then decided to go with percentage difference checks. Since we round decimals on UI, we don't need to send progress updates less than %1. OperationProgressManager handles it with concurrent dictionary. Open to suggestions, I might do more tests before merging it.