-
Notifications
You must be signed in to change notification settings - Fork 582
Improve accuracy of progress updates #144
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
…nge between read and write
This PR ensures that we enter a lock inside the `@SendableProperty` implementation as soon as we access a computed property. Additionally, it mirrors the access level of the original property. Both changes are required for [improved accuracy](apple/container#144) of progress updates in container. Additionally, it should resolve #60 that occurs on certain configurations. Please tag as 0.1.1 after merging.
# Conflicts: # Package.swift
adityaramani
left a comment
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.
Thanks! Had a couple small questions. Will also wait for more views on this
| /// A progress bar that updates itself as tasks are completed. | ||
| public final class ProgressBar: Sendable { | ||
| let config: ProgressConfig | ||
| // `@SendableProperty` adds `_state: Synchronized<State>`, which can be updated inside a lock using `_state.withLock()`. |
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.
Would this property should up in IDEs? Would the user be able to navigate into the def for the property?
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.

This PR resolves the problem of dropped progress updates and ensures the accuracy of the information provided in the progress bar. Additionally, it adds the displaying of the finished state to the progress bar. Requires merging and tagging apple/containerization#91.