addTaskUnlessCancelled(name:priority:operation:)
Adds a child task to the group, unless the group has been canceled. Returns a boolean value indicating if the task was successfully added to the group or not.
Declaration
mutating func addTaskUnlessCancelled(name: String?, priority: TaskPriority? = nil, operation: sending @escaping @isolated(any) () async -> ChildTaskResult) -> BoolParameters
- name:
Human readable name of this task.
- priority:
The priority of the operation task. Omit this parameter or pass
nilto inherit the task group’s base priority. - operation:
The operation to execute as part of the task group.
Return Value
true if the child task was added to the group; otherwise false.
See Also
Adding Tasks to a Task Group
addTask(priority:operation:)addTask(name:priority:operation:)addTask(executorPreference:priority:operation:)addTask(name:executorPreference:priority:operation:)addTaskUnlessCancelled(name:executorPreference:priority:operation:)addTaskUnlessCancelled(executorPreference:priority:operation:)addTaskUnlessCancelled(priority:operation:)addImmediateTask(name:priority:executorPreference:operation:)addImmediateTaskUnlessCancelled(name:priority:executorPreference:operation:)