@@ -89,11 +89,13 @@ public final class AsyncQueue<TaskMetadata: DependencyTracker>: Sendable {
8989 /// If this is a barrier, all previously scheduled tasks are guaranteed to
9090 /// finish execution before the barrier is executed and all tasks that are
9191 /// added later will wait until the barrier finishes execution.
92+ // Workaround formatter issue: https://github.com/swiftlang/swift-format/issues/1081
93+ // swift-format-ignore
9294 @discardableResult
9395 public func async < Success: Sendable > (
9496 priority: TaskPriority ? = nil ,
9597 metadata: TaskMetadata ,
96- @_inheritActorContext operation: @escaping @Sendable ( ) async -> Success
98+ @_inheritActorContext operation: nonisolated ( nonsending ) @escaping @Sendable ( ) async -> Success
9799 ) -> Task < Success , Never > {
98100 let throwingTask = asyncThrowing ( priority: priority, metadata: metadata, operation: operation)
99101 return Task ( priority: priority) {
@@ -111,10 +113,12 @@ public final class AsyncQueue<TaskMetadata: DependencyTracker>: Sendable {
111113 ///
112114 /// - Important: The caller is responsible for handling any errors thrown from
113115 /// the operation by awaiting the result of the returned task.
116+ // Workaround formatter issue: https://github.com/swiftlang/swift-format/issues/1081
117+ // swift-format-ignore
114118 public func asyncThrowing< Success: Sendable > (
115119 priority: TaskPriority ? = nil ,
116120 metadata: TaskMetadata ,
117- @_inheritActorContext operation: @escaping @Sendable ( ) async throws -> Success
121+ @_inheritActorContext operation: nonisolated ( nonsending ) @escaping @Sendable ( ) async throws -> Success
118122 ) -> Task < Success , any Error > {
119123 let id = UUID ( )
120124
@@ -175,19 +179,23 @@ public final class AsyncQueue<TaskMetadata: DependencyTracker>: Sendable {
175179extension AsyncQueue where TaskMetadata == Serial {
176180 /// Same as ``async(priority:operation:)`` but specialized for serial queues
177181 /// that don't specify any metadata.
182+ // Workaround formatter issue: https://github.com/swiftlang/swift-format/issues/1081
183+ // swift-format-ignore
178184 @discardableResult
179185 public func async < Success: Sendable > (
180186 priority: TaskPriority ? = nil ,
181- @_inheritActorContext operation: @escaping @Sendable ( ) async -> Success
187+ @_inheritActorContext operation: nonisolated ( nonsending ) @escaping @Sendable ( ) async -> Success
182188 ) -> Task < Success , Never > {
183189 return self . async ( priority: priority, metadata: Serial ( ) , operation: operation)
184190 }
185191
186192 /// Same as ``asyncThrowing(priority:metadata:operation:)`` but specialized
187193 /// for serial queues that don't specify any metadata.
194+ // Workaround formatter issue: https://github.com/swiftlang/swift-format/issues/1081
195+ // swift-format-ignore
188196 public func asyncThrowing< Success: Sendable > (
189197 priority: TaskPriority ? = nil ,
190- @_inheritActorContext operation: @escaping @Sendable ( ) async throws -> Success
198+ @_inheritActorContext operation: nonisolated ( nonsending ) @escaping @Sendable ( ) async throws -> Success
191199 ) -> Task < Success , any Error > {
192200 return self . asyncThrowing ( priority: priority, metadata: Serial ( ) , operation: operation)
193201 }
0 commit comments