Skip to content

Conversation

@dkovba
Copy link
Contributor

@dkovba dkovba commented Jun 11, 2025

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.

@dkovba dkovba requested a review from adityaramani June 11, 2025 15:44
crosbymichael pushed a commit to apple/containerization that referenced this pull request Jun 11, 2025
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.
@dkovba dkovba force-pushed the progress-updates branch from 27341c7 to 9439490 Compare June 12, 2025 19:26
Copy link
Contributor

@adityaramani adityaramani left a 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()`.
Copy link
Contributor

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?

Copy link
Contributor Author

@dkovba dkovba Jun 12, 2025

Choose a reason for hiding this comment

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

It it possible to see the definition of the _state property by expanding the macro using the corresponding command in the context menu:

Screenshot 2025-06-12 at 4 29 54 PM

@dkovba dkovba requested a review from adityaramani June 13, 2025 04:32
@adityaramani adityaramani merged commit 206f3cc into apple:main Jun 13, 2025
2 checks passed
@dkovba dkovba deleted the progress-updates branch June 26, 2025 22:35
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