Skip to content

Commit ff840ca

Browse files
committed
[Concurrency] Add missing 5.9 addTasks for DiscardingTaskGroups to gyb
1 parent 708fee7 commit ff840ca

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

stdlib/public/Concurrency/TaskGroup+addTask.swift.gyb

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,39 @@ import Swift
115115
% 'operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult'
116116
% ],
117117
% ),
118+
% (
119+
% 'SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY',
120+
% [
121+
% 'TaskGroup',
122+
% 'ThrowingTaskGroup',
123+
% ],
124+
% [
125+
% '@available(SwiftStdlib 5.1, *)',
126+
% '@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")',
127+
% ],
128+
% ['addTask', 'addTaskUnlessCancelled'],
129+
% [
130+
% 'priority: TaskPriority? = nil',
131+
% # throws and ChildTaskResult will be adjusted per task group type
132+
% 'operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult'
133+
% ],
134+
% ),
135+
% (
136+
% '',
137+
% [
138+
% 'DiscardingTaskGroup',
139+
% 'ThrowingDiscardingTaskGroup',
140+
% ],
141+
% [
142+
% '@available(SwiftStdlib 5.9, *)',
143+
% ],
144+
% ['addTask', 'addTaskUnlessCancelled'],
145+
% [
146+
% 'priority: TaskPriority? = nil',
147+
% # throws and ChildTaskResult will be adjusted per task group type
148+
% 'operation: sending @escaping @isolated(any) () async throws -> ChildTaskResult'
149+
% ],
150+
% ),
118151
% ]:
119152
%
120153
% for TYPE in TYPES:
@@ -181,7 +214,7 @@ extension ${TYPE} {
181214
/// - taskExecutor:
182215
/// - taskExecutor: The task executor that the child task should be started on and keep using.
183216
/// Explicitly passing `nil` as the executor preference is equivalent to
184-
/// calling the `addTask` method without a preference, and effectively
217+
/// calling the `${METHOD_NAME}` method without a preference, and effectively
185218
/// means to inherit the outer context's executor preference.
186219
/// You can also pass the ``globalConcurrentExecutor`` global executor explicitly.
187220
% end
@@ -196,9 +229,9 @@ extension ${TYPE} {
196229
/// - Returns: `true` if the child task was added to the group;
197230
/// otherwise `false`.
198231
% end
199-
${"\n ".join(ALL_AVAILABILITY)}
200232
@_alwaysEmitIntoClient
201-
public mutating func ${METHOD_NAME}(
233+
${"\n ".join(ALL_AVAILABILITY)}
234+
public mutating func ${METHOD_NAME}( // ${TYPE}/${METHOD_NAME}
202235
${",\n ".join(adjust_params_for_group_kind(PARAMS))}
203236
) ${ARROW_RETURN_TYPE}{
204237
% if IS_IMPL_UNAVAILABLE:

0 commit comments

Comments
 (0)