@@ -81,11 +81,13 @@ extension Task {
8181 ///
8282 /// - Parameters:
8383 /// - name: Human readable name of the task.
84+ /// - priority: The priority of the task.
8485 /// - fifoQueue: The queue on which to enqueue the task.
8586 /// - operation: The operation to perform.
8687 @discardableResult
8788 public init (
8889 name: String ? = nil ,
90+ priority: TaskPriority ? = nil ,
8991 on fifoQueue: FIFOQueue ,
9092 @_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated ( any) ( ) async -> Success ,
9193 ) where Failure == Never {
@@ -96,7 +98,7 @@ extension Task {
9698 await semaphore. wait ( )
9799 await delivery. execute ( { @Sendable delivery in
98100 await delivery. sendValue ( executeOnce. operation ( ) )
99- } , in: delivery, name: name) . value
101+ } , in: delivery, name: name, priority : priority ) . value
100102 }
101103 fifoQueue. taskStreamContinuation. yield ( task)
102104 self . init ( name: name) {
@@ -133,11 +135,13 @@ extension Task {
133135 ///
134136 /// - Parameters:
135137 /// - name: Human readable name of the task.
138+ /// - priority: The priority of the task.
136139 /// - fifoQueue: The queue on which to enqueue the task.
137140 /// - operation: The operation to perform.
138141 @discardableResult
139142 public init (
140143 name: String ? = nil ,
144+ priority: TaskPriority ? = nil ,
141145 on fifoQueue: FIFOQueue ,
142146 @_inheritActorContext @_implicitSelfCapture operation: sending @escaping @isolated ( any) ( ) async throws -> Success ,
143147 ) where Failure == any Error {
@@ -152,7 +156,7 @@ extension Task {
152156 } catch {
153157 delivery. sendFailure ( error)
154158 }
155- } , in: delivery, name: name) . value
159+ } , in: delivery, name: name, priority : priority ) . value
156160 }
157161 fifoQueue. taskStreamContinuation. yield ( task)
158162 self . init ( name: name) {
0 commit comments