@@ -29,10 +29,10 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
29
29
30
30
func to( step: Steps ) async throws {
31
31
// TODO: checks that we don't move backwards...
32
- log. notice ( " Move to step: \( step) " )
32
+ self . log. notice ( " Move to step: \( step) " )
33
33
self . step = step
34
34
35
- for sub in subscribers {
35
+ for sub in self . subscribers {
36
36
try await sub. currentStep ( step)
37
37
}
38
38
@@ -108,7 +108,7 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
108
108
return
109
109
}
110
110
111
- try await ensureSubscription ( )
111
+ try await self . ensureSubscription ( )
112
112
113
113
await withCheckedContinuation { ( cc: CheckedContinuation < Void , Never > ) in
114
114
self . _completedCC = cc
@@ -121,7 +121,7 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
121
121
return nil // last step was already emitted
122
122
}
123
123
124
- try await ensureSubscription ( )
124
+ try await self . ensureSubscription ( )
125
125
126
126
return await withCheckedContinuation { ( cc: CheckedContinuation < Steps , Never > ) in
127
127
self . _nextCC = cc
@@ -168,7 +168,6 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
168
168
// MARK: Progress AsyncSequence
169
169
170
170
extension DistributedProgress . Box {
171
-
172
171
public func steps( file: String = #file, line: UInt = #line) async throws -> DistributedProgressAsyncSequence < Steps > {
173
172
try await self . ensureSubscription ( )
174
173
@@ -198,7 +197,7 @@ public struct DistributedProgressAsyncSequence<Steps: DistributedProgressSteps>:
198
197
}
199
198
200
199
public func next( ) async throws -> Steps ? {
201
- try await box. nextStep ( )
200
+ try await self . box. nextStep ( )
202
201
}
203
202
}
204
203
}
@@ -210,6 +209,7 @@ public protocol DistributedProgressSteps: Codable, Sendable, Equatable, CaseIter
210
209
static var count : Int { get }
211
210
static var last : Self { get }
212
211
}
212
+
213
213
extension DistributedProgressSteps {
214
214
public static var count : Int {
215
215
precondition ( count > 0 , " \( Self . self) cannot have zero steps (cases)! " )
@@ -222,4 +222,4 @@ extension DistributedProgressSteps {
222
222
}
223
223
return last
224
224
}
225
- }
225
+ }
0 commit comments