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
// Create a task group to scope the lifetime of our three child tasks
1206
1206
tryawaitwithTaskGroup(resultType: Void.self) { group in
1207
-
await group.spawn {
1208
-
veggies =tryawaitchopVegetables()
1209
-
}
1210
-
await group.spawn {
1207
+
group.spawn {
1208
+
veggies =tryawait chgroup.spawn }
1209
+
group.spawn {
1211
1210
meat =awaitmarinateMeat()
1212
1211
}
1213
-
awaitgroup.spawn {
1212
+
group.spawn {
1214
1213
oven =awaitpreheatOven(temperature: 350)
1215
1214
}
1216
1215
}
@@ -1257,4 +1256,4 @@ Initially the `group.spawn` was designed with the idea of being an asynchronous
1257
1256
1258
1257
This was not implemented nor is it clear how efficient and meaningful this form of back-pressure really would be. A naive version of these semantics is possible to implement by balancing pending and completed task counts in the group by plain variables, so removing this implementation doe not prevent developers form implementing such "width limited" operations per se.
1259
1258
1260
-
The way to back-pressure submissions should also be considered in terms of how it relates to async let and general spawn mechanisms, not only groups. We have not figured out this completely, and rather than introduce an not-implemented API which may or may not have the right shape, for now we decided to punt on this feature until we know precisely if and how to apply this style of back-pressure on spawning tasks throughout the system.
1259
+
The way to back-pressure submissions should also be considered in terms of how it relates to async let and general spawn mechanisms, not only groups. We have not figured out this completely, and rather than introduce an not-implemented API which may or may not have the right shape, for now we decided to punt on this feature until we know precisely if and how to apply this style of back-pressure on spawning tasks throughout the system.
0 commit comments