You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Proposals/0023-progress-manager.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ public func makeSalad() async {
121
121
publicfuncchopFruits() async-> Progress {}
122
122
```
123
123
124
-
We are forced to await the `chopFruits()` call before receiving the `Progress` instance. However, the `Progress` instance that is returned from `chopFruits` already has its `completedUnitCount` equal to `totalUnitCount`. Since the `chopSubprogress` would have been completed before being added as a child to its parent `Progress`, it fails to show incremental progress as the code runs to completion within the method.
124
+
We are forced to await the `chopFruits()` call before receiving the `Progress` instance. However, the `Progress` instance that is returned from `chopFruits` already has its `completedUnitCount` equal to `totalUnitCount`. Since the `chopSubprogress` would have been completed before being added as a child to its parent `Progress`, it fails to show incremental progress as the code runs to completion within the method.
125
125
126
126
While it may be possible to use the existing `Progress` to report progress in an `async` function to show incremental progress, by passing `Progress` as an argument to the function reporting progress, it is more error-prone, as shown below:
127
127
@@ -701,12 +701,12 @@ If you would like to report additional metadata or properties that are not part
701
701
@available(FoundationPreview 6.3, *)
702
702
extensionProgressManager {
703
703
704
-
publicstructProperties {
704
+
publicenumProperties {
705
705
706
706
/// The total number of files.
707
707
publicvar totalFileCount: TotalFileCount.Type { get }
708
708
709
-
publicstructTotalFileCount : Sendable, Property {
709
+
publicenumTotalFileCount : Sendable, Property {
710
710
711
711
publictypealiasValue=Int
712
712
@@ -728,7 +728,7 @@ extension ProgressManager {
728
728
/// The number of completed files.
729
729
publicvar completedFileCount: CompletedFileCount.Type { get }
0 commit comments