@@ -74,7 +74,7 @@ public protocol IAsyncTask: AnyObject, Sendable {
74
74
/// - priority: The priority of the task, which determines its scheduling priority in the system.
75
75
/// - operation: A closure that performs an asynchronous task and returns
76
76
/// a value of type `Value` upon completion. The closure can throw an error if the task fails.
77
- func start( priority: TaskPriority ? , operation: @escaping Async . Producer < Value > )
77
+ func start( priority: TaskPriority ? , operation: @escaping Async . Producer < Value ? > )
78
78
79
79
/// Starts an asynchronous operation with a specified input.
80
80
///
@@ -86,7 +86,7 @@ public protocol IAsyncTask: AnyObject, Sendable {
86
86
/// - priority: The priority of the task, which determines its scheduling priority in the system.
87
87
/// - operation: A closure that takes an input of type `I`, performs an asynchronous task, and
88
88
/// returns a value of type `Value` upon completion. The closure can throw an error if the task fails.
89
- func start< I: Sendable > ( with input: I , priority: TaskPriority ? , operation: @escaping Async . Mapper < I , Value > )
89
+ func start< I: Sendable > ( with input: I , priority: TaskPriority ? , operation: @escaping Async . Mapper < I , Value ? > )
90
90
91
91
/// Executes an asynchronous operation and manages its lifecycle.
92
92
///
@@ -100,7 +100,7 @@ public protocol IAsyncTask: AnyObject, Sendable {
100
100
///
101
101
/// - Note: Ensures thread safety by running on the main actor, making it suitable for managing
102
102
/// UI-related tasks or state changes.
103
- func startTask( priority: TaskPriority ? , _ operation: @escaping Async . Producer < Value > )
103
+ func startTask( priority: TaskPriority ? , _ operation: @escaping Async . Producer < Value ? > )
104
104
}
105
105
106
106
@available ( iOS 15 . 0 , macOS 12 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
@@ -119,7 +119,7 @@ extension IAsyncTask {
119
119
///
120
120
/// - Note: Ensures all updates occur on the main actor, making it safe for use in UI-related contexts.
121
121
@MainActor
122
- public func start( priority: TaskPriority ? = nil , operation: @escaping Async . Producer < Value > ) {
122
+ public func start( priority: TaskPriority ? = nil , operation: @escaping Async . Producer < Value ? > ) {
123
123
startTask ( priority: priority) {
124
124
try await operation ( )
125
125
}
@@ -139,7 +139,7 @@ extension IAsyncTask {
139
139
/// - operation: A closure that takes an input of type `I`, performs an asynchronous task, and
140
140
/// returns a value of type `Value` upon completion. The closure can throw an error if the task fails.
141
141
@MainActor
142
- public func start< I: Sendable > ( with input: I , priority: TaskPriority ? = nil , operation: @escaping Async . Mapper < I , Value > ) {
142
+ public func start< I: Sendable > ( with input: I , priority: TaskPriority ? = nil , operation: @escaping Async . Mapper < I , Value ? > ) {
143
143
startTask ( priority: priority) {
144
144
try await operation ( input)
145
145
}
0 commit comments