@@ -130,7 +130,7 @@ object Future:
130
130
* If the future is created in an Async context, it is added to the
131
131
* children of that context's root.
132
132
*/
133
- def apply [T ](body : Async ?=> T )(using ac : AsyncConfig ): Future [T ] =
133
+ def apply [T ](body : Async ?=> T )(using ac : Async . Config ): Future [T ] =
134
134
val f = RunnableFuture (body)(using ac.scheduler)
135
135
ac.root.addChild(f)
136
136
f
@@ -141,7 +141,7 @@ object Future:
141
141
* If both futures succeed, succeed with their values in a pair. Otherwise,
142
142
* fail with the failure that was returned first and cancel the other.
143
143
*/
144
- def zip [T2 ](f2 : Future [T2 ])(using AsyncConfig ): Future [(T1 , T2 )] = Future :
144
+ def zip [T2 ](f2 : Future [T2 ])(using Async . Config ): Future [(T1 , T2 )] = Future :
145
145
Async .await(Async .either(f1, f2)) match
146
146
case Left (Success (x1)) => (x1, f2.value)
147
147
case Right (Success (x2)) => (f1.value, x2)
@@ -152,7 +152,7 @@ object Future:
152
152
* If either task succeeds, succeed with the success that was returned first
153
153
* and cancel the other. Otherwise, fail with the failure that was returned last.
154
154
*/
155
- def alt [T2 >: T1 ](f2 : Future [T2 ])(using AsyncConfig ): Future [T2 ] = Future :
155
+ def alt [T2 >: T1 ](f2 : Future [T2 ])(using Async . Config ): Future [T2 ] = Future :
156
156
Async .await(Async .either(f1, f2)) match
157
157
case Left (Success (x1)) => f2.cancel(); x1
158
158
case Right (Success (x2)) => f1.cancel(); x2
@@ -187,7 +187,7 @@ end Future
187
187
class Task [+ T ](val body : Async ?=> T ):
188
188
189
189
/** Start a future computed from the `body` of this task */
190
- def run (using AsyncConfig ) = Future (body)
190
+ def run (using Async . Config ) = Future (body)
191
191
192
192
end Task
193
193
0 commit comments