Skip to content

Commit 70555e0

Browse files
committed
Track the rename from spawn -> async.
Fixes rdar://78548755
1 parent f1d87de commit 70555e0

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import Swift
1616
// ==== TaskGroup --------------------------------------------------------------
1717

1818
/// Starts a new task group which provides a scope in which a dynamic number of
19-
/// tasks may be spawned.
19+
/// tasks may be created.
2020
///
2121
/// When the group returns,
22-
/// it implicitly waits for all spawned tasks to complete.
22+
/// it implicitly waits for all child tasks to complete.
2323
/// The tasks are canceled only if `cancelAll()` was invoked before returning,
2424
/// if the group's task was canceled.
2525
///
@@ -50,14 +50,14 @@ import Swift
5050
/// Canceling the task in which the group is running
5151
/// also cancels the group and all of its child tasks.
5252
///
53-
/// If you call `spawn(priority:operation:)` to create a new task in a canceled group,
53+
/// If you call `async(priority:operation:)` to create a new task in a canceled group,
5454
/// that task is immediately canceled after creation.
55-
/// Alternatively, you can call `spawnUnlessCancelled(priority:operation:)`,
56-
/// which doesn't spawn the task if the group has already been canceled
55+
/// Alternatively, you can call `asyncUnlessCancelled(priority:operation:)`,
56+
/// which doesn't create the task if the group has already been canceled
5757
/// Choosing between these two functions
5858
/// lets you control how to react to cancellation within a group:
5959
/// some child tasks need to run regardless of cancellation
60-
/// and others are better not even being spawned
60+
/// and others are better not even being created
6161
/// knowing they can't produce useful results.
6262
///
6363
/// Because the tasks you add to a group with this method are nonthrowing,
@@ -91,10 +91,10 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
9191
#endif
9292
}
9393

94-
/// Starts a new scope in which a dynamic number of throwing tasks can be spawned.
94+
/// Starts a new scope in which a dynamic number of throwing tasks can be created.
9595
///
9696
/// When the group returns,
97-
/// it implicitly waits for all spawned tasks to complete.
97+
/// it implicitly waits for all child tasks to complete.
9898
/// The tasks are canceled only if `cancelAll()` was invoked before returning,
9999
/// if the group's task was canceled,
100100
/// or if the group's body throws an error.
@@ -126,14 +126,14 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
126126
/// Canceling the task in which the group is running
127127
/// also cancels the group and all of its child tasks.
128128
///
129-
/// If you call `spawn(priority:operation:)` to create a new task in a canceled group,
129+
/// If you call `async(priority:operation:)` to create a new task in a canceled group,
130130
/// that task is is immediately canceled after being created.
131-
/// Alternatively, you can call `spawnUnlessCancelled(priority:operation:)`,
132-
/// which doesn't spawn the task if the group has already been canceled
131+
/// Alternatively, you can call `asyncUnlessCancelled(priority:operation:)`,
132+
/// which doesn't create the task if the group has already been canceled
133133
/// Choosing between these two functions
134134
/// lets you control how to react to cancellation within a group:
135135
/// some child tasks need to run regardless of cancellation
136-
/// and others are better not even being spawned
136+
/// and others are better not even being created
137137
/// knowing they can't produce useful results.
138138
///
139139
/// Throwing an error in one of the tasks of a task group
@@ -145,14 +145,14 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
145145
/// nothing is canceled and the group doesn't throw an error:
146146
///
147147
/// withThrowingTaskGroup { group in
148-
/// group.spawn { throw SomeError() }
148+
/// group.async { throw SomeError() }
149149
/// }
150150
///
151151
/// In contrast, this example throws `SomeError`
152152
/// and cancels all of the tasks in the group:
153153
///
154154
/// withThrowingTaskGroup { group in
155-
/// group.spawn { throw SomeError() }
155+
/// group.async { throw SomeError() }
156156
/// try group.next()
157157
/// }
158158
///
@@ -194,7 +194,7 @@ public func withThrowingTaskGroup<ChildTaskResult, GroupResult>(
194194
#endif
195195
}
196196

197-
/// A task group serves as storage for dynamically spawned child tasks.
197+
/// A task group serves as storage for dynamically created child tasks.
198198
///
199199
/// To create a task group,
200200
/// call the `withTaskGroup(of:returning:body:)` method.
@@ -315,8 +315,8 @@ public struct TaskGroup<ChildTaskResult> {
315315
/// not in the order that those tasks were added to the task group.
316316
/// For example:
317317
///
318-
/// group.spawn { 1 }
319-
/// group.spawn { 2 }
318+
/// group.async { 1 }
319+
/// group.async { 2 }
320320
///
321321
/// print(await group.next())
322322
/// // Prints either "2" or "1".
@@ -424,7 +424,7 @@ public struct TaskGroup<ChildTaskResult> {
424424
// proofing, in case we'd ever have typed errors, however unlikely this may be.
425425
// Today the throwing task group failure is simply automatically bound to `Error`.
426426

427-
/// A task group serves as storage for dynamically spawned,
427+
/// A task group serves as storage for dynamically created,
428428
/// potentially throwing, child tasks.
429429
///
430430
@available(SwiftStdlib 5.5, *)
@@ -454,7 +454,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
454454
}
455455
}
456456

457-
/// Spawn, unconditionally, a child task in the group.
457+
/// Unconditionally create a child task in the group.
458458
///
459459
/// ### Error handling
460460
/// Operations are allowed to `throw`, in which case the `try await next()`
@@ -550,8 +550,8 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
550550
/// not in the order that those tasks were added to the task group.
551551
/// For example:
552552
///
553-
/// group.spawn { 1 }
554-
/// group.spawn { 2 }
553+
/// group.async { 1 }
554+
/// group.async { 2 }
555555
///
556556
/// await print(group.next())
557557
/// // Prints either "2" or "1".
@@ -610,8 +610,8 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
610610
/// not in the order that those tasks were added to the task group.
611611
/// For example:
612612
///
613-
/// group.spawn { 1 }
614-
/// group.spawn { 2 }
613+
/// group.async { 1 }
614+
/// group.async { 2 }
615615
///
616616
/// guard let result = await group.nextResult() else {
617617
/// return // No task to wait on, which won't happen in this example.
@@ -710,9 +710,9 @@ extension TaskGroup: AsyncSequence {
710710
/// which you can use to continue iterating over the group's results.
711711
/// For example:
712712
///
713-
/// group.spawn { 1 }
714-
/// group.spawn { throw SomeError }
715-
/// group.spawn { 2 }
713+
/// group.async { 1 }
714+
/// group.async { throw SomeError }
715+
/// group.async { 2 }
716716
///
717717
/// do {
718718
/// // Assuming the child tasks complete in order, this prints "1"

0 commit comments

Comments
 (0)