Instance Methodswift 6.1.2_Concurrency
addTask(operation:)
- iOS
- 17.0+
- macOS
- 14.0+
- tvOS
- 17.0+
- watchOS
- 10.0+
mutating func addTask(operation: sending @escaping @isolated(any) () async -> Void)
mutating func addTask(operation: sending @escaping @isolated(any) () async -> Void)
s12_Concurrency19DiscardingTaskGroupV03addC09operationyyyYaYAcn_tF
What are these?6S1VF
import _Concurrency
@frozen struct DiscardingTaskGroup
A discarding group that contains dynamically created child tasks.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
var isCancelled: Bool { get }
A Boolean value that indicates whether the group was canceled.
var isEmpty: Bool { get }
A Boolean value that indicates whether the group has any remaining tasks.
mutating func addTask(executorPreference taskExecutor: (any TaskExecutor)?, priority: TaskPriority? = nil, operation: sending @escaping @isolated(any) () async -> Void)
Adds a child task to the group and enqueue it on the specified executor.
mutating func addTask(priority: TaskPriority? = nil, operation: sending @escaping @isolated(any) () async -> Void)
Adds a child task to the group.
mutating func addTaskUnlessCancelled(executorPreference taskExecutor: (any TaskExecutor)?, priority: TaskPriority? = nil, operation: sending @escaping @isolated(any) () async -> Void) -> Bool
Adds a child task to the group and set it up with the passed in task executor preference, unless the group has been canceled.
mutating func addTaskUnlessCancelled(operation: sending @escaping @isolated(any) () async -> Void) -> Bool
Adds a child task to the group, unless the group has been canceled.
mutating func addTaskUnlessCancelled(priority: TaskPriority? = nil, operation: sending @escaping @isolated(any) () async -> Void) -> Bool
Adds a child task to the group, unless the group has been canceled.
func cancelAll()
Cancel all of the remaining tasks in the group.