Static Methodswift 6.0.1_Concurrency
withCancellationHandler(handler:operation:)
This declaration is deprecated: `Task.withCancellationHandler` has been replaced by `withTaskCancellationHandler` and will be removed shortly.
static func withCancellationHandler<T>(handler: () -> Void, operation: () async throws -> T) async rethrows -> T
Other members in extension
Typealiases
Show obsolete interfaces (3)
Hide obsolete interfaces
Type members
static var basePriority: TaskPriority?
The current task’s base priority.
static var currentPriority: TaskPriority
The current task’s priority.
static var isCancelled: Bool
A Boolean value that indicates whether the task should stop executing.
static func checkCancellation(
) throws Throws an error if the task was canceled.
static func sleep<C>(for: C.Instant.Duration, tolerance: C.Instant.Duration?, clock: C
) async throws Suspends the current task for the given duration.
static func sleep(nanoseconds: UInt64
) async throws Suspends the current task for at least the given duration in nanoseconds.
static func sleep<C>(until: C.Instant, tolerance: C.Instant.Duration?, clock: C
) async throws Suspends the current task until the given deadline within a tolerance.
static func yield(
) async Suspends the current task and allows other tasks to execute.
Show obsolete interfaces (4)
Hide obsolete interfaces
static func CancellationError(
) -> CancellationError static func sleep(UInt64
) async static func suspend(
) async static func withGroup<TaskResult, BodyResult>(resultType: TaskResult.Type, returning: BodyResult.Type, body: (inout Task<Success, Failure>.Group<TaskResult>) async throws -> BodyResult
) async rethrows -> BodyResult