@@ -122,7 +122,7 @@ public distributed actor WorkerPool<Worker: DistributedWorker>: DistributedWorke
122122 level: self . logLevel,
123123 " Incoming work, selecting worker " ,
124124 metadata: [
125- " workers/count " : " \( self . size) " ,
125+ " workers/count " : " \( self . size ( ) ) " ,
126126 " worker/item " : " \( work) " ,
127127 ]
128128 )
@@ -132,13 +132,14 @@ public distributed actor WorkerPool<Worker: DistributedWorker>: DistributedWorke
132132 " Selected worker, submitting [ \( work) ] to [ \( worker) ] " ,
133133 metadata: [
134134 " worker " : " \( worker. id) " ,
135- " workers/count " : " \( self . size) " ,
135+ " workers/count " : " \( self . size ( ) ) " ,
136136 ]
137137 )
138138 return try await worker. submit ( work: work)
139139 }
140140
141- distributed var size : Int {
141+ // FIXME: there is an issue in latest Swift (6.2 nightlies) with Cxx interop, change back to computed properties when fixed.
142+ internal distributed func size( ) -> Int {
142143 self . workers. count
143144 }
144145
@@ -198,11 +199,11 @@ public distributed actor WorkerPool<Worker: DistributedWorker>: DistributedWorke
198199 case . random:
199200 return self . workers. shuffled ( ) . first
200201 case . simpleRoundRobin:
201- if self . roundRobinPos >= self . size {
202+ if self . roundRobinPos >= self . size ( ) {
202203 self . roundRobinPos = 0 // loop around from zero
203204 }
204205 let selected = self . workers [ self . roundRobinPos]
205- self . roundRobinPos = self . workers. index ( after: self . roundRobinPos) % self . size
206+ self . roundRobinPos = self . workers. index ( after: self . roundRobinPos) % self . size ( )
206207 return selected
207208 }
208209 }
0 commit comments